szetszwo commented on code in PR #1595:
URL: https://github.com/apache/ratis/pull/1595#discussion_r4033466875
##########
ratis-server/src/main/java/org/apache/ratis/server/raftlog/segmented/LogSegment.java:
##########
@@ -492,7 +492,7 @@ void putEntryCache(TermIndex key, LogEntryProto value, Op
op) {
long previousSize = 0;
if (previous != null) {
// Different threads maybe load LogSegment file into cache at the same
time, so duplicate maybe happen
- previousSize = getEntrySize(value, Op.REMOVE_CACHE);
+ previousSize = getEntrySize(previous, Op.REMOVE_CACHE);
Review Comment:
Since value and previous are at the same TermIndex, they have to be the
same. (If not, it is a more serious bug.)
It is still good to fix this minor bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]