Skip to content

Partially moves compactions into the manager#3460

Merged
keith-turner merged 7 commits into
apache:elasticityfrom
keith-turner:compactions-in-manager
Jun 20, 2023
Merged

Partially moves compactions into the manager#3460
keith-turner merged 7 commits into
apache:elasticityfrom
keith-turner:compactions-in-manager

Conversation

@keith-turner
Copy link
Copy Markdown
Contributor

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 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.
Comment thread assemble/bin/accumulo-cluster
Comment thread core/src/main/java/org/apache/accumulo/core/conf/Property.java
@keith-turner
Copy link
Copy Markdown
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.

@EdColeman
Copy link
Copy Markdown
Contributor

FYI, SlowOps has a startCompactTask that will block until the compactions are running that might be more robust than an arbitrary sleep.

@keith-turner
Copy link
Copy Markdown
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.

@ctubbsii ctubbsii added this to the 4.0.0 milestone Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Offline operations: Move compaction functionality from tablets servers to manager

5 participants