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

*: Don't block flushes on cleaning turns #1124

Merged
merged 1 commit into from
May 3, 2021

Conversation

itsbilal
Copy link
Contributor

@itsbilal itsbilal commented May 3, 2021

A flush isn't marked as complete (and flushing set to
false) until deleteObsoleteFiles returns. Currently,
deleteObsoleteFiles waits for other cleaning turns to complete
before doing its own cleaning. This could make flushes wait
for cleanup after large compactions, causing write stalls.

This change makes flushes move along and mark themselves as
completed if a cleaner job is already running, instead of waiting
for them. This allows for a lower impact on user-observed
write latency.

@itsbilal itsbilal requested review from jbowens and petermattis May 3, 2021 14:48
@itsbilal itsbilal self-assigned this May 3, 2021
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

:lgtm:

Is this something we can add a test for? I'm imagining a test where we grab the cleaning turn, run a flush/ingest while the turn is held and verify it completes.

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

A flush isn't marked as complete (and flushing set to
false) until deleteObsoleteFiles returns. Currently,
deleteObsoleteFiles waits for other cleaning turns to complete
before doing its own cleaning. This could make flushes wait
for cleanup after large compactions, causing write stalls.

This change makes flushes move along and mark themselves as
completed if a cleaner job is already running, instead of waiting
for them. This allows for a lower impact on user-observed
write latency.
@itsbilal itsbilal force-pushed the flush-dont-wait-cleaners branch from 48a0e53 to 6f7a8c3 Compare May 3, 2021 15:38
Copy link
Contributor Author

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

Added a test! Basically does just that - grabs a cleaning turn then does a flush.

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

Copy link
Collaborator

@petermattis petermattis 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:

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

@itsbilal
Copy link
Contributor Author

itsbilal commented May 3, 2021

TFTR!

@itsbilal itsbilal merged commit f8e879e into cockroachdb:master May 3, 2021
@itsbilal itsbilal deleted the flush-dont-wait-cleaners branch May 3, 2021 17:00
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