We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fd4b3a commit 32157baCopy full SHA for 32157ba
1 file changed
ratis-server/src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java
@@ -141,7 +141,9 @@ synchronized void append(List<ConsecutiveIndices> entriesTermIndices) {
141
// validate startIndex
142
final Map.Entry<Long, ConsecutiveIndices> lastEntry = map.lastEntry();
143
if (lastEntry != null) {
144
- Preconditions.assertSame(lastEntry.getValue().getNextIndex(), indices.startIndex, "startIndex");
+ final long nextIndex = lastEntry.getValue().getNextIndex();
145
+ Preconditions.assertTrue(indices.startIndex >= nextIndex,
146
+ () -> "startIndex = " + indices.startIndex + " < nextIndex = " + nextIndex);
147
}
148
map.put(indices.startIndex, indices);
149
0 commit comments