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

release-20.2: kv: don't leak raft application tracing spans on or after ErrRemoved #54267

Merged

Conversation

nvanbenschoten
Copy link
Member

Backport 3/3 commits from #54140.

The cherry-picks were all clean.

/cc @cockroachdb/release


Fixes #53677.

This change ensures that we properly finish tracing spans of Raft commands that throw ErrRemoved errors in ApplySideEffects. It then ensures that we properly finish tracing spans of Raft commands that follow a command that throws an ErrRemoved. Before this, these commands would be abandoned and would never be finished. The effects of this are theoretically even worse than those fixed in the previous commit because these leaked commands could be locally proposed, so we may be abandoning a local proposer indefinitely.

It's not clear that we ever saw an instance of this. It seems rare for a local proposal to end up in the same CommittedEntries batch as a command that removes a replica because of the lease requirements, but it doesn't seem impossible, especially of the local proposal was a RequestLease request.

I was originally intending to do something more dramatic and make replicaStateMachine.ApplySideEffects responsible for acknowledging proposers in all cases, but doing so turned out to be pretty invasive so I was concerned that it would be harder to backport to v20.2 and to v20.1. I may revisit that in the future.

Release justification: low risk, high benefit changes to existing functionality.

Release justification: low risk, high benefit changes to existing
functionality.
Fixes cockroachdb#53677.

This commit ensures that we properly finish tracing spans of
Raft commands that throw ErrRemoved errors in ApplySideEffects.

I was originally intending to do something more dramatic and make
`replicaStateMachine.ApplySideEffects` responsible for acknowledging
proposers in all cases, but doing so turned out to be pretty invasive
so I was concerned that it would be harder to backport to v20.2 and
to v20.1. I may revisit that in the future.

Release justification: low risk, high benefit changes to existing
functionality.
Extension of cockroachdb#53677.

This commit ensures that we properly finish tracing spans of Raft
commands that follow a command that throws a ErrRemoved. Before this
commit, these commands would be abandoned and would never be finished.
The effects of this are theoretically even worse than those fixed in the
previous commit because these leaked commands could be locally proposed,
so we may be abandoning a local proposer indefinitely.

It's not clear that we ever saw an instance of this. It seems rare for a
local proposal to end up in the same CommittedEntries batch as a command
that removes a replica because of the lease requirements, but it doesn't
seem impossible, especially of the local proposal was a RequestLease
request.

Release justification: low risk, high benefit changes to existing
functionality.
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner)

@nvanbenschoten
Copy link
Member Author

TFTR!

@nvanbenschoten nvanbenschoten merged commit 2f40eb2 into cockroachdb:release-20.2 Sep 11, 2020
@nvanbenschoten nvanbenschoten deleted the backport20.2-54140 branch September 14, 2020 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants