Skip to content

Commit a0b4978

Browse files
authored
[To dev/1.3] Pipe: Fixed the bug that concurrent modification / compaction of the mod file may cause mod hard-link failure (#16044)
* mod * fix
1 parent 2757110 commit a0b4978

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/tsfile/PipeTsFileResourceManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,10 @@ public void pinTsFileResource(
352352
throws IOException {
353353
increaseFileReference(resource.getTsFile(), true, pipeName);
354354
if (withMods && resource.getModFile().exists()) {
355-
increaseFileReference(new File(resource.getModFile().getFilePath()), false, pipeName);
355+
// Avoid mod compaction
356+
synchronized (resource.getModFile()) {
357+
increaseFileReference(new File(resource.getModFile().getFilePath()), false, pipeName);
358+
}
356359
}
357360
}
358361

0 commit comments

Comments
 (0)