Skip to content

Commit

Permalink
Merge #30988
Browse files Browse the repository at this point in the history
30988: storage/ui: add remote proposals to Range debug page r=nvanbenschoten a=nvanbenschoten

This would have helped when debugging #30064.

<img width="807" alt="screen shot 2018-10-04 at 5 37 55 pm" src="https://user-images.githubusercontent.com/5438456/46504662-8f9e4380-c7fc-11e8-90b9-25b92867bd27.png">

Release note: None

Co-authored-by: Nathan VanBenschoten <[email protected]>
  • Loading branch information
craig[bot] and nvanbenschoten committed Oct 8, 2018
2 parents 804202f + f2f3fd2 commit 7826069
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 @@ -1908,6 +1908,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 7826069

Please sign in to comment.