Skip to content

Commit cd8f3db

Browse files
authored
Fixed that InsertionCompactionSelection may skip a file deleted by another compaction (#17254)
* Fixed that InsertionCompactionSelection may skip a file deleted by another compaction * Update
1 parent 35ef0c8 commit cd8f3db

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/impl/RewriteCrossSpaceCompactionSelector.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,12 @@ private InsertionCrossCompactionTaskResource selectCurrentUnSeqFile(
490490
nextSeqFileIndex = Math.min(nextSeqFileIndex, i);
491491
}
492492
if (!seqFile.containsDevice(deviceId)) {
493+
// if the seqFile is deleted by another compaction concurrently,
494+
// we cannot ensure whether the seqFile overlaps with the unseqFile.
495+
// Let a later selection retry with compacted file.
496+
if (!seqFile.hasDetailedDeviceInfo()) {
497+
return result;
498+
}
493499
continue;
494500
}
495501
DeviceInfo seqDeviceInfo = seqFile.getDeviceInfoById(deviceId);

0 commit comments

Comments
 (0)