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

kvserver: log when acquiring lease as a draining node #79296

Conversation

aayushshah15
Copy link
Contributor

@aayushshah15 aayushshah15 commented Apr 3, 2022

Generally, draining nodes are not allowed to acquire leases. Additionally,
replicas that are not Raft leaders are not allowed to acquire leases. This
means that draining nodes have to be permitted to acquire leases for replicas
that they are the Raft leaders for (otherwise, we risk a deadlock since no
replicas will be allowed to acquire the lease).

This commit adds a verbose log event when a draining store acquires a lease
because it is the Raft leader.

Release note: none

Jira issue: CRDB-14751

@aayushshah15 aayushshah15 requested a review from a team as a code owner April 3, 2022 19:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@aayushshah15 aayushshah15 requested review from andreimatei and tbg April 3, 2022 19:30
@aayushshah15 aayushshah15 force-pushed the 20220403_logWhenStealingLeaseAsADrainingNode branch 2 times, most recently from 61fd234 to 690295e Compare April 4, 2022 02:53
),
)
}
log.VEventf(
Copy link
Member

Choose a reason for hiding this comment

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

This won't usually end up in the logs. Do we want to promote it to log.Info so that it will?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Generally, draining nodes are not allowed to acquire leases. Additionally,
replicas that are not Raft leaders are not allowed to acquire leases. This
means that draining nodes have to be permitted to acquire leases for replicas
that they are the Raft leaders for.

This commit adds a verbose log event when a draining store acquires a lease
because it is the Raft leader.

Release note: none
@aayushshah15 aayushshah15 force-pushed the 20220403_logWhenStealingLeaseAsADrainingNode branch from 690295e to 5ffaa9e Compare April 4, 2022 16:43
@aayushshah15
Copy link
Contributor Author

TFTR

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 4, 2022

Build succeeded:

@craig craig bot merged commit 2108206 into cockroachdb:master Apr 4, 2022
@aayushshah15
Copy link
Contributor Author

blathers backport 21.2 22.1

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.

4 participants