Partially moves compactions into the manager#3460
Merged
keith-turner merged 7 commits intoJun 20, 2023
Merged
Conversation
This commit moves system compactions into the manager. User compactions are not done yet. The TabletManagmentIterator now finds tablets that need compaction by calling the compaction dispatcher and compaction planner plugins. Any tablets that needs compaction is returned to the manager where it runs the plugins again to generate compaction jobs. The compaction jobs are placed in a new bounded priority queue. The queue is bounded in size to prevent exhausting manager memory, it keeps the Top N jobs with the highest priority. The CompactionCoordinator pulls jobs out of then new queue when compactors request work. A conditional mutation is used in the compaction coordinator to atomically reserve the files for compaction. When the compactor reports the job is done the coordinator atomically updates the tablet metadata using a conditional mutation and if the tablet is hosted its asked to refresh its metadata. User compactions in the manager still need to be implemented. Also many loose ends still need to be implemented for system compactions, these changes will be done in follow on commits.
This was referenced Jun 9, 2023
dlmarion
reviewed
Jun 9, 2023
This was referenced Jun 9, 2023
Contributor
Author
|
I have only run one test for this so far. I ran BulIT.testManyFiles() its a new test as part of this PR that bulk imports 100 files into two tablets. I manually added a sleep at the end of that test to give the compactions time to happen. Then I would look in the manager logs and see multiple compactions happening against the tablet. |
Contributor
|
FYI, SlowOps has a startCompactTask that will block until the compactions are running that might be more robust than an arbitrary sleep. |
ddanielr
reviewed
Jun 13, 2023
ddanielr
reviewed
Jun 13, 2023
Contributor
Author
|
I merged this changes as I will soon be making a PR to move user compactions to the manager that builds on these changes. |
This was referenced Jun 22, 2023
This was referenced Jul 18, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit moves system compactions into the manager. User compactions are not done yet. The TabletManagmentIterator now finds tablets that need compaction by calling the compaction dispatcher and compaction planner plugins. Any tablets that needs compaction is returned to the manager where it runs the plugins again to generate compaction jobs. The compaction jobs are placed in a new bounded priority queue. The queue is bounded in size to prevent exhausting manager memory, it keeps the Top N jobs with the highest priority. The CompactionCoordinator pulls jobs out of then new queue when compactors request work. A conditional mutation is used in the compaction coordinator to atomically reserve the files for compaction. When the compactor reports the job is done the coordinator atomically updates the tablet metadata using a conditional mutation and if the tablet is hosted its asked to refresh its metadata.
User compactions in the manager still need to be implemented. Also many loose ends still need to be implemented for system compactions, these changes will be done in follow on commits.