Conversation
This reverts commit b3c729d.
| public void onCompactionStatusComputed( | ||
| public void onSkippedCandidate( | ||
| CompactionCandidate candidateSegments, | ||
| DataSourceCompactionConfig config |
Check notice
Code scanning / CodeQL
Useless parameter Note
| final DataSegment segment = new DataSegment( | ||
| "foo", | ||
| Intervals.of("2023-01-0" + i + "/2023-01-0" + (i + 1)), | ||
| "2023-01-0" + i, | ||
| ImmutableMap.of("path", "a-" + i), | ||
| ImmutableList.of("dim1"), | ||
| ImmutableList.of("m1"), | ||
| new DimensionRangeShardSpec(List.of("dim1"), null, null, i - 1, 8), | ||
| 9, | ||
| 100 | ||
| ); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test
|
Wanted to point out that #19016 is aiming at similar goals but is taking a different approach. The big one is that #19016 only works with non-MSQ compaction and this one only works with MSQ compaction. Longer comment on the other PR here: #19016 (comment) |
|
@gianm is there a plan that the msq based compaction replaces the old one? otherwise we have two different mechanisms, which not only confuses users but also increases the effort to maintain the code base. |
Description
This PR builds on #18968 to add incremental compaction support, allowing compaction to operate on only uncompacted segments within an interval while upgrading already-compacted segments to maintain consistency.
Key Changes
Extended CompactionMode enum with INCREMENTAL_COMPACTION:
New task action that upgrades segment metadata without rewriting data:
Extended ShardSpec interface with mutation methods to support incremental compaction:
Added optional uncompactedSegments field:
Added incrementalCompactionUncompactedRatioThreshold to MostFragmentedIntervalFirstPolicy:
Replaced verbose 19-parameter constructors with builder pattern for better readability.
Release Note
Added incremental compaction mode that compacts only newly ingested segments while preserving already-compacted data. Configure using incrementalCompactionUncompactedRatioThreshold in MostFragmentedIntervalFirstPolicy to control when incremental compaction is used based on the ratio of uncompacted to compacted data. Only supported by compaction supervisors on Overlord with MSQ engine.
Key changed/added classes
This PR has: