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

crl-release-23.1: db: improve delete pacing #2696

Merged

Conversation

RaduBerinde
Copy link
Member

Delete pacing is currently an on or off decision. If we are running out of space or have too many obsolete bytes in relation to live bytes, we disable pacing. Otherwise we pace at the configured rate (128MB by default in CRDB).

This change improves pacing by keeping track of the average deletion rate over the last 5 minutes and increasing the target rate to match this rate if necessary. The intention is to avoid deletions lagging behind.

Informs #2662.

I have tested this change against a heavy write workload where deletion is known to lag behind (resulting in 10k+ goroutines waiting in the pacer); with the change, the goroutine count is small and stable (after the first 5-10 minutes):
image

Delete pacing is currently an on or off decision. If we are running
out of space or have too many obsolete bytes in relation to live
bytes, we disable pacing. Otherwise we pace at the configured rate
(128MB by default in CRDB).

This change improves pacing by keeping track of the average deletion
rate over the last 5 minutes and increasing the target rate to match
this rate if necessary. The intention is to avoid deletions lagging
behind.

Informs cockroachdb#2662.
@RaduBerinde RaduBerinde requested review from jbowens and a team June 29, 2023 16:33
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member Author

Note: this is a backport of #2673, adapted to the 23.1 codebase.

Copy link
Collaborator

@jbowens jbowens left a comment

Choose a reason for hiding this comment

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

:lgtm_strong:

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @RaduBerinde)

@RaduBerinde RaduBerinde merged commit c0a2ede into cockroachdb:crl-release-23.1 Jun 30, 2023
@RaduBerinde RaduBerinde deleted the delete-history-23.1 branch June 30, 2023 14:39
RaduBerinde added a commit to RaduBerinde/cockroach that referenced this pull request Jun 30, 2023
…598cb059

c0a2ede2 db: improve delete pacing (cockroachdb/pebble#2696)

Informs cockroachdb#2662.

Release justification: fixes very high goroutine count on heavy write
workloads with fast disks.

Release note (bug fix): On heavy write workloads with fast disks, the
deletion of obsolete LSM files could fall behind, causing high
goroutine count. Pacing of obsolete file deletion now adapts based on
recent deletion rate to avoid falling behind.
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