From 6a9db12261debfd7eeadb33d8d8daebb12f6b081 Mon Sep 17 00:00:00 2001 From: latcn Date: Mon, 26 Jan 2026 18:43:48 +0800 Subject: [PATCH] fix: truncate rebuild indexFile --- .../storage/dledger/store/file/DLedgerMmapFileStore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dledger/src/main/java/io/openmessaging/storage/dledger/store/file/DLedgerMmapFileStore.java b/dledger/src/main/java/io/openmessaging/storage/dledger/store/file/DLedgerMmapFileStore.java index c776d157..25ed0d93 100644 --- a/dledger/src/main/java/io/openmessaging/storage/dledger/store/file/DLedgerMmapFileStore.java +++ b/dledger/src/main/java/io/openmessaging/storage/dledger/store/file/DLedgerMmapFileStore.java @@ -455,7 +455,7 @@ public long truncate(long truncateIndex) { indexFileList.truncateOffset(truncateIndexFilePos); if (indexFileList.getMaxWrotePosition() != truncateIndexFilePos) { LOGGER.warn("[TRUNCATE] truncate for index file error, try to truncate pos: {}, but after truncate, max wrote pos: {}, now try to rebuild", truncateIndexFilePos, indexFileList.getMaxWrotePosition()); - PreConditions.check(dataFileList.rebuildWithPos(truncateStartPos), DLedgerResponseCode.DISK_ERROR, "rebuild index file truncatePos=%d", truncateIndexFilePos); + PreConditions.check(indexFileList.rebuildWithPos(truncateIndexFilePos), DLedgerResponseCode.DISK_ERROR, "rebuild index file truncatePos=%d", truncateIndexFilePos); } reviseIndexFileListFlushedWhere(truncateIndexFilePos);