This is an automated email from the ASF dual-hosted git repository.
szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git
The following commit(s) were added to refs/heads/master by this push:
new ca81a218f Revert "RATIS-2278. Follower Fails to Append Entries Due to
Index Validation in NavigableIndices (#1247)"
ca81a218f is described below
commit ca81a218f31b4e686bcfdb1d5cb3eb5a8c0ce8fd
Author: Tsz-Wo Nicholas Sze <[email protected]>
AuthorDate: Thu Apr 17 09:03:02 2025 -0700
Revert "RATIS-2278. Follower Fails to Append Entries Due to Index
Validation in NavigableIndices (#1247)"
This reverts commit f5e993549330708d85570af8462ee00c879aba2c.
---
.../src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git
a/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java
b/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java
index e4f661afc..c5010a534 100644
---
a/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java
+++
b/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerImplUtils.java
@@ -141,9 +141,7 @@ public final class ServerImplUtils {
// validate startIndex
final Map.Entry<Long, ConsecutiveIndices> lastEntry = map.lastEntry();
if (lastEntry != null) {
- final long nextIndex = lastEntry.getValue().getNextIndex();
- Preconditions.assertTrue(indices.startIndex >= nextIndex,
- () -> "startIndex = " + indices.startIndex + " < nextIndex =
" + nextIndex);
+ Preconditions.assertSame(lastEntry.getValue().getNextIndex(),
indices.startIndex, "startIndex");
}
map.put(indices.startIndex, indices);
}