-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
26039: compactor: never stop the loop r=bdarnell a=tschottdorf The compactor had an optimization that would stop the compactor loop when no work was to be done. Unfortunately, the condition to probe this was incorrect. Essentially, whenever *any* work had been done, the loop stopped and would not reawaken until the next incoming suggestion. In the absence of such a suggestion, the skipped existing suggestions would never be revisited, and thus never discarded. This created confusion as it kept the "queued bytes" metric up. Refactor the code so that instead of stopping, the loop waits for the max age before running again (except if there are further suggestions). It's hard to use timers correctly, so this commit should be scrutinized. In particular, whether it's correct to call `t.Reset` in a select that does not read from the timer's channel. The test change makes `make test PKG=./pkg/storage/compactor` fail every time on my machine before the fix. I would suggest not backporting this, at least not until there is a follow-up bugfix that needs backporting and doesn't apply cleanly on top of this diff. Fixes #21824. Release note (bug fix): Expired compaction suggestions are now dropped not too soon after they expire. Previously, this could be delayed indefinitely. Co-authored-by: Tobias Schottdorf <[email protected]>
- Loading branch information
Showing
3 changed files
with
47 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters