Skip to content

Commit

Permalink
storage/ui: add remote proposals to Range debug page
Browse files Browse the repository at this point in the history
This would have helped when debugging cockroachdb#30064.

Release note: None
  • Loading branch information
nvanbenschoten committed Oct 4, 2018
1 parent 9c6b390 commit f2f3fd2
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 63 deletions.
1 change: 1 addition & 0 deletions pkg/storage/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,7 @@ func (r *Replica) State() storagebase.RangeInfo {
ri.ReplicaState = *(protoutil.Clone(&r.mu.state)).(*storagebase.ReplicaState)
ri.LastIndex = r.mu.lastIndex
ri.NumPending = uint64(len(r.mu.localProposals))
ri.NumRemotePending = uint64(len(r.mu.remoteProposals))
ri.RaftLogSize = r.mu.raftLogSize
ri.NumDropped = uint64(r.mu.droppedMessages)
if r.mu.proposalQuota != nil {
Expand Down
157 changes: 95 additions & 62 deletions pkg/storage/storagebase/state.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/storage/storagebase/state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ message RangeInfo {
// The highest (and last) index in the Raft log.
uint64 last_index = 2;
uint64 num_pending = 3;
uint64 num_remote_pending = 9;
reserved 4; // previously last verification timestamp for verify queue.
uint64 num_dropped = 5;
// raft_log_size may be initially inaccurate after a server restart.
Expand Down
4 changes: 3 additions & 1 deletion pkg/ui/src/views/reports/containers/range/rangeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ const rangeTableDisplayList: RangeTableRow[] = [
{ variable: "leaseHolderQPS", display: "Lease Holder QPS", compareToLeader: false },
{ variable: "keysWrittenPS", display: "Average Keys Written Per Second", compareToLeader: false },
{ variable: "approxProposalQuota", display: "Approx Proposal Quota", compareToLeader: false },
{ variable: "pendingCommands", display: "Pending Commands", compareToLeader: false },
{ variable: "pendingCommands", display: "Pending Local Commands", compareToLeader: false },
{ variable: "remoteCommands", display: "Pending Remote Commands", compareToLeader: false },
{ variable: "droppedCommands", display: "Dropped Commands", compareToLeader: false },
{ variable: "truncatedIndex", display: "Truncated Index", compareToLeader: true },
{ variable: "truncatedTerm", display: "Truncated Term", compareToLeader: true },
Expand Down Expand Up @@ -485,6 +486,7 @@ export default class RangeTable extends React.Component<RangeTableProps, {}> {
keysWrittenPS: this.createContent(info.stats.writes_per_second.toFixed(4)),
approxProposalQuota: raftLeader ? this.createContent(FixLong(info.state.approximate_proposal_quota)) : rangeTableEmptyContent,
pendingCommands: this.createContent(FixLong(info.state.num_pending)),
remoteCommands: raftLeader ? this.createContent(FixLong(info.state.num_remote_pending)) : rangeTableEmptyContent,
droppedCommands: this.createContent(
FixLong(info.state.num_dropped),
FixLong(info.state.num_dropped).greaterThan(0) ? "range-table__cell--warning" : "",
Expand Down

0 comments on commit f2f3fd2

Please sign in to comment.