- The time period of time travel may be very long, such as dozens of days, so it is still necessary to merge small segments within the scope of time travel.
- When to trigger a compaction:
- After a segment flush, if the total number of segments less than 1/2*max_segment_size at channel&partition level exceeds the compaction_ segment_ num_ threshold.
- The time interval from the last compaction is greater than max_ compaction_ interval
- call compaction manually
- How to choose segments: greedy algorithmalgorithm‘
- Only merge flushed segments
- We choose the max dml position of merged segments as the dml position of the new generated segment.