Skip to content

Commit

Permalink
fix FileManger.truncatePrefix bug
Browse files Browse the repository at this point in the history
该bug会导致宕机,生成了hs_err_pidxxx.log,原因是底层的MappedByteBuffer被unmap,但仍然存在put操作
  • Loading branch information
bybyset committed Aug 24, 2023
1 parent 19ed179 commit 313309a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public boolean truncatePrefix(final long firstIndexKept) {
for (final AbstractFile abstractFile : this.files) {
final long lastLogIndex = abstractFile.getLastLogIndex();
if (lastLogIndex < firstIndexKept) {
willRemoveFiles.addAll(this.files);
willRemoveFiles.add(abstractFile);
}
}
return true;
Expand Down

0 comments on commit 313309a

Please sign in to comment.