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

db: improve delete pacing #2673

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

RaduBerinde
Copy link
Member

@RaduBerinde RaduBerinde commented Jun 24, 2023

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.

Fixes #2662.

@RaduBerinde RaduBerinde requested review from jbowens and a team June 24, 2023 01:47
@cockroach-teamcity
Copy link
Member

This change is Reviewable

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.

Looks great!

:lgtm:

Reviewed 22 of 22 files at r1, 2 of 3 files at r2, all commit messages.
Reviewable status: 2 of 22 files reviewed, 1 unresolved discussion (waiting on @RaduBerinde)


pacer.go line 169 at r3 (raw file):

	for h.currEpoch < epoch {
		h.currEpoch++
		// Forget the data for the oldest second.

nit: s/second/epoch/

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.

Fixes cockroachdb#2662.
@RaduBerinde RaduBerinde force-pushed the deletion-rate-hist-2 branch from ca89ca2 to df16d0f Compare June 27, 2023 16:32
Copy link
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

TFTR!

Reviewable status: 1 of 22 files reviewed, all discussions resolved (waiting on @jbowens)

@RaduBerinde RaduBerinde merged commit 41563fd into cockroachdb:master Jun 28, 2023
@RaduBerinde RaduBerinde deleted the deletion-rate-hist-2 branch June 28, 2023 16:48
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.

db: adaptively throttle file deletions
3 participants