Conversation
…ndariesForMajor Fix verified RED->GREEN. getCompactBoundariesForMajor silently drops files lacking CUSTOM_TIERING_TIME_RANGE at CustomDateTieredCompactionPolicy.java:72
wchevreuil
left a comment
There was a problem hiding this comment.
Yes, currently, if no file in the list has the CUSTOM_TIERING_TIME_RANGE tag, getCompactBoundariesForMajor returns a single MIN boundary, and a single file will result from the compaction. This single resulting file will now have the CUSTOM_TIERING_TIME_RANGE tag, and a subsequent compaction would be able to define two boundaries, if the time range cross the cutOffTimestamp. This is not optimal, this fix would solve this, but after reviewing this getCompactBoundariesForMajor and the append logic in CustomTieringMultiFileWriter, I think we can simply always set the min and cutOffTimestamp boundaries without needing to traverse the files to check the CUSTOM_TIERING_TIME_RANGE.
Please open a jira ticket to link this PR.
| long now) { | ||
| MutableLong min = new MutableLong(Long.MAX_VALUE); | ||
| MutableLong max = new MutableLong(0); | ||
| boolean[] hasMissing = new boolean[1]; |
There was a problem hiding this comment.
No need to declare an array here.
… cutOffTimestamp boundary CustomTieringMultiFileWriter#append already routes each cell to its tier by comparing against the returned boundaries and skips committing a file for a tier that receives no data, so traversing filesToCompact to inspect CUSTOM_TIERING_TIME_RANGE is unnecessary. Always returning [MIN_VALUE, cutOffTimestamp] is simpler and does not miss the boundary when a file lacks the metadata.
|
Removed the boolean[] array and simplified: getCompactBoundariesForMajor now always returns [MIN_VALUE, cutOffTimestamp] without traversing filesToCompact, since CustomTieringMultiFileWriter#append already buckets by boundary and skips committing empty tiers. Fixed in 7637d74. |
Thank you very much for reporting and addressing this. Before we can merge this, we need a related jira ticket created under https://issues.apache.org/jira/projects/HBASE. If you don't have a jira account yet, you can request one at https://selfserve.apache.org/jira-account.html. Please make sure to select hbase as the 'ASF project you want to file a ticket' so we can receive your request and process it. |
|
Working on getting the JIRA filed and linked. Also flagging something CI caught: implementing the simplified
That's arguably a nice side effect (it also fixes the "first compaction can't split" limitation), but it's a real behavior change beyond the reported bug. Want me to update those 5 tests/comments to match the new intended behavior, or would you rather I do a narrower fix that only handles the mixed tagged/untagged case without changing first-compaction semantics? |
…Timestamp boundary getCompactBoundariesForMajor now always returns [MIN_VALUE, cutOffTimestamp] regardless of file metadata, so the first major compaction on untagged files can already split old and recent cells into separate tiers instead of producing a single file. Update the boundary-count and HFile-count assertions in TestCustomCellTieredCompactionPolicy and TestCustomCellTieredCompactor to match.
|
The simplified approach from the 2026-08-26 review (always return On the 5 tests flagged in my 2026-09-01 comment: I went with updating the tests to match the new intended behavior rather than a narrower fix, landed in 681823b.
On "No need to declare an array here" on |
Thanks for the work here, and yes, the tests should be updated as you did here to reflect the new behaviour. This looks ready to be merged, but we need to a jira to link it first. Please @me on the jira once you create it so that I can assign it to you and proceed with the PR merge. |
|
Ping @shoemoney |
Bug: getCompactBoundariesForMajor silently drops files lacking CUSTOM_TIERING_TIME_RANGE, so compaction boundaries miss the cutOffTimestamp split.
Fix: getCompactBoundariesForMajor now always returns [MIN_VALUE, cutOffTimestamp] without traversing filesToCompact. This is safe because CustomTieringMultiFileWriter#append already buckets each cell by these boundaries and only commits a file for a tier that received data.
Verified: existing compaction tests pass. Single file changed: CustomDateTieredCompactionPolicy.java (removed the min/max traversal and MutableLong tracking, replaced with a short comment).