Skip to content

Conversation

@keith-turner
Copy link
Contributor

Makes the default compaction planner use the table id when prioritizing compactions. The root table id is always given the highest priority, followed by the metadata table, then user tables.

Fixes #4033

Makes the default compaction planner use the table id when prioritizing
compactions.  The root table id is always given the highest priority,
followed by the metadata table, then user tables.

Fixes apache#4033
compactingFiles);

int prio = totalFiles + compactingFiles;
// This holds the two bits used to encode the priority of the table.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the work in #4133 change anything with this compaction priority calculation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it could. We could add the table id from that work into this calculation once its merged

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are two bits for the table and only three of those fours slots currently being used. Can use the 4th slot for #4133. If this is merged before #4133, may need to open an issue.

Copy link
Contributor

@ddanielr ddanielr left a comment

Choose a reason for hiding this comment

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

I like this change as it's very quick to understand the range calculation and ranges can have different amounts instead of the available range being equally divided across all tables.

I also think this is easier for users to pick up and modify for their own custom compaction service.

@keith-turner keith-turner merged commit c7deced into apache:elasticity Jan 9, 2024
keith-turner added a commit that referenced this pull request Jan 10, 2024
In #4142 a refactoring was done and an unused variable was left over
from that.  This commit removes the unused variable.
@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.

Modify the DefaultCompactionPlanner to set priorities at a table name level

3 participants