Skip to content

Commit 3290c99

Browse files
committed
Relax max_seq_no_of_updates assertion in follow tests
If there's a failover on the follower, then its max_seq_no_of_updates is bootstrapped from its max_seq_no which might be higher than the max_seq_no_of_updates of the leader. We need to relax this check. Relates #40249
1 parent 1e94e93 commit 3290c99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/action/ShardFollowTaskReplicationTests.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
import static java.util.Collections.emptyMap;
8080
import static java.util.Collections.emptySet;
8181
import static org.hamcrest.Matchers.equalTo;
82+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
8283
import static org.hamcrest.Matchers.is;
8384
import static org.hamcrest.Matchers.nullValue;
8485

@@ -620,7 +621,8 @@ private void assertConsistentHistoryBetweenLeaderAndFollower(ReplicationGroup le
620621
}
621622
for (IndexShard followingShard : follower) {
622623
if (assertMaxSeqNoOfUpdatesOrDeletes) {
623-
assertThat(followingShard.getMaxSeqNoOfUpdatesOrDeletes(), equalTo(leader.getPrimary().getMaxSeqNoOfUpdatesOrDeletes()));
624+
assertThat(followingShard.getMaxSeqNoOfUpdatesOrDeletes(),
625+
greaterThanOrEqualTo(leader.getPrimary().getMaxSeqNoOfUpdatesOrDeletes()));
624626
}
625627
List<Tuple<String, Long>> docAndSeqNosOnFollower = getDocIdAndSeqNos(followingShard).stream()
626628
.map(d -> Tuple.tuple(d.getId(), d.getSeqNo())).collect(Collectors.toList());

0 commit comments

Comments
 (0)