Skip to content

Commit 938af30

Browse files
RkGritszetszwo
authored andcommitted
RATIS-2282. LogAppender Restart Due to Premature Log Entry Access During Concurrent Write Processing (apache#1249)
1 parent b7c7d7f commit 938af30

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented

ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/LogSegment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ private void append(boolean keepEntryInCache, LogEntryProto entry, Op op) {
328328
}
329329

330330
final LogRecord record = new LogRecord(totalFileSize, entry);
331-
records.add(record);
332331
if (keepEntryInCache) {
333332
putEntryCache(record.getTermIndex(), entry, op);
334333
}
334+
records.add(record);
335335
totalFileSize += getEntrySize(entry, op);
336336
endIndex = entry.getIndex();
337337
}

0 commit comments

Comments
 (0)