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: eagerly enqueue less preferred leases for transfer #116081

Closed
kvoli opened this issue Dec 11, 2023 · 0 comments · Fixed by #120441
Closed

kvserver: eagerly enqueue less preferred leases for transfer #116081

kvoli opened this issue Dec 11, 2023 · 0 comments · Fixed by #120441
Assignees
Labels
A-kv-distribution Relating to rebalancing and leasing. branch-release-24.1 Used to mark GA and release blockers, technical advisories, and bugs for 24.1 C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs P-2 Issues/test failures with a fix SLA of 3 months release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-kv KV Team

Comments

@kvoli
Copy link
Collaborator

kvoli commented Dec 11, 2023

Is your feature request related to a problem? Please describe.
In #107507 we began enqueueing ranges when acquiring a lease violating its configured preferences. This work didn't extend to less preferred preferences e.g.

# Leases in region=b and region=c.
lease_preferences = '[[+region=a], [+region=b], [+region=c]]'"

case LeasePreferencesOK, LeasePreferencesLessPreferred:
// We could also enqueue the lease when we are a less preferred
// leaseholder, however the replicate queue will eventually get to it and
// we already satisfy _some_ preference.
case LeasePreferencesViolating:
log.VEventf(ctx, 2,
"acquired lease violates lease preferences, enqueuing for transfer [lease=%v preferences=%v]",
newLease, r.mu.conf.LeasePreferences)
r.store.replicateQueue.AddAsync(ctx, r, replicateQueueLeasePreferencePriority)

Describe the solution you'd like

Extend the eager enqueue to also include less preferred leases, as users will often specify every locality in descending priority order -- meaning no lease will ever be violating a preference, only less preferred or ok.

Jira issue: CRDB-34427

@kvoli kvoli added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs A-kv-distribution Relating to rebalancing and leasing. labels Dec 11, 2023
@blathers-crl blathers-crl bot added the T-kv KV Team label Dec 11, 2023
@kvoli kvoli added the P-2 Issues/test failures with a fix SLA of 3 months label Dec 11, 2023
@nvanbenschoten nvanbenschoten added release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. branch-release-24.1 Used to mark GA and release blockers, technical advisories, and bugs for 24.1 labels Mar 13, 2024
@kvoli kvoli self-assigned this Mar 14, 2024
cockroach-dev-inf pushed a commit that referenced this issue Mar 15, 2024
Leases are checked against lease preferences after application, when a
lease violates the applied preferences it is enqueued into the lease
queue. Leases may also satisfy some preference but not the first one, in
which case they are considered less preferred.

Less preferred leases previously needed to wait for the replica scanner
to enqueue them into the lease queue before the lease would be
considered to be moved to the first preference.

Enqueue less preferred leases after application, similar to leases
violating applied preferences.

Resolves: #116081
Release note: None
craig bot pushed a commit that referenced this issue Mar 25, 2024
120441: kvserver: pro-actively enqueue less preferred leases into lease queue r=andrewbaptist a=kvoli

Leases are checked against lease preferences after application, when a
lease violates the applied preferences it is enqueued into the lease
queue. Leases may also satisfy some preference but not the first one, in
which case they are considered less preferred.

Less preferred leases previously needed to wait for the replica scanner
to enqueue them into the lease queue before the lease would be
considered to be moved to the first preference.

Enqueue less preferred leases after application, similar to leases
violating applied preferences.

Resolves: #116081
Release note: None

Co-authored-by: Austen McClernon <[email protected]>
@craig craig bot closed this as completed in ba13d19 Mar 25, 2024
@github-project-automation github-project-automation bot moved this to Closed in KV Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-kv-distribution Relating to rebalancing and leasing. branch-release-24.1 Used to mark GA and release blockers, technical advisories, and bugs for 24.1 C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) O-support Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs P-2 Issues/test failures with a fix SLA of 3 months release-blocker Indicates a release-blocker. Use with branch-release-2x.x label to denote which branch is blocked. T-kv KV Team
Projects
No open projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants