diff --git a/docs/generated/http/full.md b/docs/generated/http/full.md
index 3059c4f009ec..e6707bb6427b 100644
--- a/docs/generated/http/full.md
+++ b/docs/generated/http/full.md
@@ -1229,6 +1229,9 @@ Support status: [reserved](#support-status)
| locks_with_wait_queues | [int64](#cockroach.server.serverpb.RaftDebugResponse-int64) | | | [reserved](#support-status) |
| lock_wait_queue_waiters | [int64](#cockroach.server.serverpb.RaftDebugResponse-int64) | | | [reserved](#support-status) |
| top_k_locks_by_wait_queue_waiters | [RangeInfo.LockInfo](#cockroach.server.serverpb.RaftDebugResponse-cockroach.server.serverpb.RangeInfo.LockInfo) | repeated | | [reserved](#support-status) |
+| locality | [Locality](#cockroach.server.serverpb.RaftDebugResponse-cockroach.server.serverpb.Locality) | | | [reserved](#support-status) |
+| is_leaseholder | [bool](#cockroach.server.serverpb.RaftDebugResponse-bool) | | | [reserved](#support-status) |
+| lease_valid | [bool](#cockroach.server.serverpb.RaftDebugResponse-bool) | | | [reserved](#support-status) |
@@ -1353,6 +1356,34 @@ only.
+
+#### Locality
+
+Locality is an ordered set of key value Tiers that describe a node's
+location. The tier keys should be the same across all nodes.
+
+| Field | Type | Label | Description | Support status |
+| ----- | ---- | ----- | ----------- | -------------- |
+| tiers | [Tier](#cockroach.server.serverpb.RaftDebugResponse-cockroach.server.serverpb.Tier) | repeated | | [reserved](#support-status) |
+
+
+
+
+
+
+#### Tier
+
+Tier represents one level of the locality hierarchy.
+
+| Field | Type | Label | Description | Support status |
+| ----- | ---- | ----- | ----------- | -------------- |
+| key | [string](#cockroach.server.serverpb.RaftDebugResponse-string) | | Key is the name of tier and should match all other nodes. | [reserved](#support-status) |
+| value | [string](#cockroach.server.serverpb.RaftDebugResponse-string) | | Value is node specific value corresponding to the key. | [reserved](#support-status) |
+
+
+
+
+
#### RaftRangeError
@@ -1436,6 +1467,9 @@ Support status: [reserved](#support-status)
| locks_with_wait_queues | [int64](#cockroach.server.serverpb.RangesResponse-int64) | | | [reserved](#support-status) |
| lock_wait_queue_waiters | [int64](#cockroach.server.serverpb.RangesResponse-int64) | | | [reserved](#support-status) |
| top_k_locks_by_wait_queue_waiters | [RangeInfo.LockInfo](#cockroach.server.serverpb.RangesResponse-cockroach.server.serverpb.RangeInfo.LockInfo) | repeated | | [reserved](#support-status) |
+| locality | [Locality](#cockroach.server.serverpb.RangesResponse-cockroach.server.serverpb.Locality) | | | [reserved](#support-status) |
+| is_leaseholder | [bool](#cockroach.server.serverpb.RangesResponse-bool) | | | [reserved](#support-status) |
+| lease_valid | [bool](#cockroach.server.serverpb.RangesResponse-bool) | | | [reserved](#support-status) |
@@ -1560,6 +1594,34 @@ only.
+
+#### Locality
+
+Locality is an ordered set of key value Tiers that describe a node's
+location. The tier keys should be the same across all nodes.
+
+| Field | Type | Label | Description | Support status |
+| ----- | ---- | ----- | ----------- | -------------- |
+| tiers | [Tier](#cockroach.server.serverpb.RangesResponse-cockroach.server.serverpb.Tier) | repeated | | [reserved](#support-status) |
+
+
+
+
+
+
+#### Tier
+
+Tier represents one level of the locality hierarchy.
+
+| Field | Type | Label | Description | Support status |
+| ----- | ---- | ----- | ----------- | -------------- |
+| key | [string](#cockroach.server.serverpb.RangesResponse-string) | | Key is the name of tier and should match all other nodes. | [reserved](#support-status) |
+| value | [string](#cockroach.server.serverpb.RangesResponse-string) | | Value is node specific value corresponding to the key. | [reserved](#support-status) |
+
+
+
+
+
## Gossip
@@ -3314,6 +3376,9 @@ Support status: [reserved](#support-status)
| locks_with_wait_queues | [int64](#cockroach.server.serverpb.RangeResponse-int64) | | | [reserved](#support-status) |
| lock_wait_queue_waiters | [int64](#cockroach.server.serverpb.RangeResponse-int64) | | | [reserved](#support-status) |
| top_k_locks_by_wait_queue_waiters | [RangeInfo.LockInfo](#cockroach.server.serverpb.RangeResponse-cockroach.server.serverpb.RangeInfo.LockInfo) | repeated | | [reserved](#support-status) |
+| locality | [Locality](#cockroach.server.serverpb.RangeResponse-cockroach.server.serverpb.Locality) | | | [reserved](#support-status) |
+| is_leaseholder | [bool](#cockroach.server.serverpb.RangeResponse-bool) | | | [reserved](#support-status) |
+| lease_valid | [bool](#cockroach.server.serverpb.RangeResponse-bool) | | | [reserved](#support-status) |
@@ -3438,6 +3503,34 @@ only.
+
+#### Locality
+
+Locality is an ordered set of key value Tiers that describe a node's
+location. The tier keys should be the same across all nodes.
+
+| Field | Type | Label | Description | Support status |
+| ----- | ---- | ----- | ----------- | -------------- |
+| tiers | [Tier](#cockroach.server.serverpb.RangeResponse-cockroach.server.serverpb.Tier) | repeated | | [reserved](#support-status) |
+
+
+
+
+
+
+#### Tier
+
+Tier represents one level of the locality hierarchy.
+
+| Field | Type | Label | Description | Support status |
+| ----- | ---- | ----- | ----------- | -------------- |
+| key | [string](#cockroach.server.serverpb.RangeResponse-string) | | Key is the name of tier and should match all other nodes. | [reserved](#support-status) |
+| value | [string](#cockroach.server.serverpb.RangeResponse-string) | | Value is node specific value corresponding to the key. | [reserved](#support-status) |
+
+
+
+
+
## Diagnostics
diff --git a/pkg/server/serverpb/status.proto b/pkg/server/serverpb/status.proto
index a45a6d50d078..1784bb533aa1 100644
--- a/pkg/server/serverpb/status.proto
+++ b/pkg/server/serverpb/status.proto
@@ -447,6 +447,9 @@ message RangeInfo {
int64 waiting_writers = 6;
}
repeated LockInfo top_k_locks_by_wait_queue_waiters = 21 [ (gogoproto.nullable) = false ];
+ Locality locality = 22;
+ bool is_leaseholder = 23;
+ bool lease_valid = 24;
}
message RangesRequest {
diff --git a/pkg/server/status.go b/pkg/server/status.go
index 1f8d7c9b01cb..760becceb3b5 100644
--- a/pkg/server/status.go
+++ b/pkg/server/status.go
@@ -1944,6 +1944,13 @@ func (s *statusServer) rangesHelper(
})
}
qps, _ := rep.QueriesPerSecond()
+ locality := serverpb.Locality{}
+ for _, tier := range rep.GetNodeLocality().Tiers {
+ locality.Tiers = append(locality.Tiers, serverpb.Tier{
+ Key: tier.Key,
+ Value: tier.Value,
+ })
+ }
return serverpb.RangeInfo{
Span: span,
RaftState: raftState,
@@ -1975,6 +1982,9 @@ func (s *statusServer) rangesHelper(
LocksWithWaitQueues: metrics.LockTableMetrics.LocksWithWaitQueues,
LockWaitQueueWaiters: metrics.LockTableMetrics.Waiters,
TopKLocksByWaitQueueWaiters: topKLocksByWaiters,
+ Locality: &locality,
+ IsLeaseholder: metrics.Leaseholder,
+ LeaseValid: metrics.LeaseValid,
}
}
diff --git a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx
index d6b8451506d4..928c7a6aa4b6 100644
--- a/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx
+++ b/pkg/ui/workspaces/db-console/src/views/reports/containers/range/rangeTable.tsx
@@ -61,6 +61,12 @@ const rangeTableDisplayList: RangeTableRow[] = [
{ variable: "leaseState", display: "Lease State", compareToLeader: true },
{ variable: "leaseHolder", display: "Lease Holder", compareToLeader: true },
{ variable: "leaseEpoch", display: "Lease Epoch", compareToLeader: true },
+ {
+ variable: "isLeaseholder",
+ display: "Is Leaseholder",
+ compareToLeader: false,
+ },
+ { variable: "leaseValid", display: "Lease Valid", compareToLeader: false },
{ variable: "leaseStart", display: "Lease Start", compareToLeader: true },
{
variable: "leaseExpiration",
@@ -244,6 +250,11 @@ const rangeTableDisplayList: RangeTableRow[] = [
display: "Circuit Breaker Error",
compareToLeader: false,
},
+ {
+ variable: "locality",
+ display: "Locality Info",
+ compareToLeader: false,
+ },
];
const rangeTableEmptyContent: RangeTableCellContent = {
@@ -706,6 +717,8 @@ export default class RangeTable extends React.Component {
leaseEpoch: epoch
? this.createContent(lease.epoch)
: rangeTableEmptyContent,
+ isLeaseholder: this.createContent(String(info.is_leaseholder)),
+ leaseValid: this.createContent(String(info.lease_valid)),
leaseStart: this.contentTimestamp(lease.start, now),
leaseExpiration: epoch
? rangeTableEmptyContent
@@ -862,6 +875,12 @@ export default class RangeTable extends React.Component {
circuitBreakerError: this.createContent(
info.state.circuit_breaker_error,
),
+ locality: this.contentIf(_.size(info.locality.tiers) > 0, () => ({
+ value: _.map(
+ info.locality.tiers,
+ tier => `${tier.key}: ${tier.value}`,
+ ),
+ })),
});
});