Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kv: add raft.commands.pending metric #123264

Merged

Conversation

nvanbenschoten
Copy link
Member

Fixes #123259.

This commit adds a new metric called raft.commands.pending. This metric tracks the number of Raft commands that the leaseholders on a node are tracking as in-flight. These commands will be periodically reproposed until they are applied or until they fail, either unequivocally or ambiguously.

Demonstration that this is hooked up properly while running cockroach workload run kv --init --concurrency=512:

Screenshot 2024-04-29 at 5 55 44 PM

Release note: None

@nvanbenschoten nvanbenschoten added backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. labels Apr 29, 2024
@nvanbenschoten nvanbenschoten requested review from a team as code owners April 29, 2024 21:58
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@kvoli kvoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @miraradeva)

Copy link
Contributor

@miraradeva miraradeva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Is it true that RaftCommandsProposed = RaftCommandsPending + RaftCommandsReproposed + RaftCommandsReproposedLAI?

Reviewed 6 of 6 files at r1, all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/kv/kvserver/replica_metrics.go line 56 at r1 (raw file):

	BehindCount           int64
	PausedFollowerCount   int64
	RaftProposalCount     int64

It's a little confusing that there is another metric here called RaftCommandsProposed. Should this one be RaftCommandsPending for consistency?

Fixes cockroachdb#123259.

This commit adds a new metric called `raft.commands.pending`. This
metric tracks the number of Raft commands that the leaseholders on a
node are tracking as in-flight. These commands will be periodically
reproposed until they are applied or until they fail, either
unequivocally or ambiguously.

Release note: None
Copy link
Member Author

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTRs!

bors r=kvoli,miraradeva

Is it true that RaftCommandsProposed = RaftCommandsPending + RaftCommandsReproposed + RaftCommandsReproposedLAI?

Not quite. The other three are counters, not gauges, so they'll continue to tick up even as RaftCommandsPending bounces off of 0.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @kvoli and @miraradeva)


pkg/kv/kvserver/replica_metrics.go line 56 at r1 (raw file):

Previously, miraradeva (Mira Radeva) wrote…

It's a little confusing that there is another metric here called RaftCommandsProposed. Should this one be RaftCommandsPending for consistency?

Good point, done.

@craig craig bot merged commit f2459fb into cockroachdb:master May 2, 2024
18 of 19 checks passed
Copy link

blathers-crl bot commented May 2, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from a687bb1 to blathers/backport-release-23.1-123264: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/numPropsMetric branch May 2, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1 backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kv: add raft.commands.pending metric
4 participants