> I assume you talking about decision of automatic compaction regarding which time intervals will be compacted (maybe you can attach some ticket references please?).
yes. that is correct.
The current algorithm is a simple "latest first" algorithm, so the Coordinator starts with the latest interval past the offset that needs compaction and isn't locked for ingestion, marks that one for compaction, and continues backwards in time. Coordinator wakes up periodically (based on indexing period?) to re-check all intervals to find the latest interval that needs compaction.
With "traditional" compaction hard locks are employed, so generally intervals won't be compacted until they are past the "late arrival" range after which no more data is ingested and no more ingestion locks are being held. So once compaction runs on those intervals that are "free from locks" it will rarely have to run on them ever again. Therefore compaction can work it's way back through history and eventually compact everything. But the latest intervals are never compacted until they reach that offset or clear the always-locked intervals.
With concurrent compaction however, the lockouts don't happen, so Coordinator will pick the latest interval that needs compaction, locked or not. Which generally means the latest interval. Concurrent compaction will run on that interval, compacting all historical segments that existed when the job started, and generates a new compacted set of segments. However ingestion has created one or more segments while the compaction job was running, so by the time the compaction job finishes there will be one or more new segments added to that interval, thereby needing compaction. So Coordinator will choose it again. And again ... etc. it may never leave that latest interval.
There are a few things you can do to try to spread the compaction work around, such as running several compaction jobs at once, so they will take consecutive intervals. but ultimately when those jobs finish if there was any new ingestion, those intervals will have to run again. So you can also change the offsets while the jobs are running, to point the next set of jobs to a different time range ... but that is a highly manual process.
The "balanced" scheduler under development will take into account "level of need", e.g. may go after intervals that have the most number of uncompacted segments, or the highest volume of uncompacted data ... so should end up taking care of the situation. It may be a compromising act though, e.g. you may end up with all of your time intervals being 90% compacted, vs 90% of your time intervals being fully compacted and 10% not compacted at all ... so I imagine it is going to take some field testing to come up with a good algorithm here that serves everyone well (... or have multiple algorithms to deal with different use cases).
There is an internal design doc for this but I don't see any PRs as yet ...