Process only flushed/flushing segment in global compaction (#13339)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2021-12-14 15:15:10 +08:00 committed by GitHub
parent 3a2aace6f0
commit 8476791492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,7 +238,8 @@ func (t *compactionTrigger) handleGlobalSignal(signal *compactionSignal) {
if t.compactionHandler.isFull() {
return
}
segments := t.meta.segments.GetSegments()
// only flushed or flushing(flushed but not notified) segments
segments := t.meta.SelectSegments(isFlush)
singleCompactionPlans := t.globalSingleCompaction(segments, false, signal)
if len(singleCompactionPlans) != 0 {
log.Debug("global single compaction plans", zap.Int64("signalID", signal.id), zap.Int64s("plans", getPlanIDs(singleCompactionPlans)))