You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, @wenweihu86 , I think there is an issue with the condition that directly returns null when endIndex == 0. This is because there is a type of Segment file named open-i, which typically indicates that the Segment can continue accepting new entries, and their endIndex is represented as 0. If such a condition is set, when the function's input index falls within a Segment like open-i, it will only return null, which I think is inappropriate.
Hi, @wenweihu86 , I think there is an issue with the condition that directly returns null when
endIndex == 0
. This is because there is a type of Segment file namedopen-i
, which typically indicates that the Segment can continue accepting new entries, and their endIndex is represented as 0. If such a condition is set, when the function's input index falls within a Segment likeopen-i
, it will only return null, which I think is inappropriate.raft-java/raft-java-core/src/main/java/com/github/wenweihu86/raft/storage/Segment.java
Lines 31 to 34 in 50761c6
Suggested fix:
if (startIndex == 0 || endIndex == 0)
=>if (startIndex == 0)
I'm looking forward to your confirmation, and would be happy to help fix the issue if needed.
The text was updated successfully, but these errors were encountered: