Skip to content

Commit f2f3fd2

Browse files
storage/ui: add remote proposals to Range debug page
This would have helped when debugging #30064. Release note: None
1 parent 9c6b390 commit f2f3fd2

File tree

4 files changed

+100
-63
lines changed

4 files changed

+100
-63
lines changed

pkg/storage/replica.go

+1
Original file line numberDiff line numberDiff line change
@@ -1905,6 +1905,7 @@ func (r *Replica) State() storagebase.RangeInfo {
19051905
ri.ReplicaState = *(protoutil.Clone(&r.mu.state)).(*storagebase.ReplicaState)
19061906
ri.LastIndex = r.mu.lastIndex
19071907
ri.NumPending = uint64(len(r.mu.localProposals))
1908+
ri.NumRemotePending = uint64(len(r.mu.remoteProposals))
19081909
ri.RaftLogSize = r.mu.raftLogSize
19091910
ri.NumDropped = uint64(r.mu.droppedMessages)
19101911
if r.mu.proposalQuota != nil {

pkg/storage/storagebase/state.pb.go

+95-62
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/storage/storagebase/state.proto

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ message RangeInfo {
9090
// The highest (and last) index in the Raft log.
9191
uint64 last_index = 2;
9292
uint64 num_pending = 3;
93+
uint64 num_remote_pending = 9;
9394
reserved 4; // previously last verification timestamp for verify queue.
9495
uint64 num_dropped = 5;
9596
// raft_log_size may be initially inaccurate after a server restart.

pkg/ui/src/views/reports/containers/range/rangeTable.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ const rangeTableDisplayList: RangeTableRow[] = [
6060
{ variable: "leaseHolderQPS", display: "Lease Holder QPS", compareToLeader: false },
6161
{ variable: "keysWrittenPS", display: "Average Keys Written Per Second", compareToLeader: false },
6262
{ variable: "approxProposalQuota", display: "Approx Proposal Quota", compareToLeader: false },
63-
{ variable: "pendingCommands", display: "Pending Commands", compareToLeader: false },
63+
{ variable: "pendingCommands", display: "Pending Local Commands", compareToLeader: false },
64+
{ variable: "remoteCommands", display: "Pending Remote Commands", compareToLeader: false },
6465
{ variable: "droppedCommands", display: "Dropped Commands", compareToLeader: false },
6566
{ variable: "truncatedIndex", display: "Truncated Index", compareToLeader: true },
6667
{ variable: "truncatedTerm", display: "Truncated Term", compareToLeader: true },
@@ -485,6 +486,7 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> {
485486
keysWrittenPS: this.createContent(info.stats.writes_per_second.toFixed(4)),
486487
approxProposalQuota: raftLeader ? this.createContent(FixLong(info.state.approximate_proposal_quota)) : rangeTableEmptyContent,
487488
pendingCommands: this.createContent(FixLong(info.state.num_pending)),
489+
remoteCommands: raftLeader ? this.createContent(FixLong(info.state.num_remote_pending)) : rangeTableEmptyContent,
488490
droppedCommands: this.createContent(
489491
FixLong(info.state.num_dropped),
490492
FixLong(info.state.num_dropped).greaterThan(0) ? "range-table__cell--warning" : "",

0 commit comments

Comments
 (0)