lib/storage: do not remove parts outside the configured retention if they are currently merged

These parts are automatically removed after the merge is complete.
This commit is contained in:
Aliaksandr Valialkin 2020-12-24 08:50:10 +02:00
parent 9df60518bb
commit 9e4ed5e591

View File

@ -1324,13 +1324,13 @@ func (pt *partition) removeStaleParts() {
pt.partsLock.Lock()
for _, pw := range pt.bigParts {
if pw.p.ph.MaxTimestamp < retentionDeadline {
if !pw.isInMerge && pw.p.ph.MaxTimestamp < retentionDeadline {
atomic.AddUint64(&pt.bigRowsDeleted, pw.p.ph.RowsCount)
m[pw] = true
}
}
for _, pw := range pt.smallParts {
if pw.p.ph.MaxTimestamp < retentionDeadline {
if !pw.isInMerge && pw.p.ph.MaxTimestamp < retentionDeadline {
atomic.AddUint64(&pt.smallRowsDeleted, pw.p.ph.RowsCount)
m[pw] = true
}