Skip to content

Commit 1fc64c9

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 7bfc454 commit 1fc64c9

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
@@ -78,6 +78,7 @@
7878
import static java.util.Collections.emptyMap;
7979
import static java.util.Collections.emptySet;
8080
import static org.hamcrest.Matchers.equalTo;
81+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
8182
import static org.hamcrest.Matchers.is;
8283
import static org.hamcrest.Matchers.nullValue;
8384

@@ -618,7 +619,8 @@ private void assertConsistentHistoryBetweenLeaderAndFollower(ReplicationGroup le
618619
}
619620
for (IndexShard followingShard : follower) {
620621
if (assertMaxSeqNoOfUpdatesOrDeletes) {
621-
assertThat(followingShard.getMaxSeqNoOfUpdatesOrDeletes(), equalTo(leader.getPrimary().getMaxSeqNoOfUpdatesOrDeletes()));
622+
assertThat(followingShard.getMaxSeqNoOfUpdatesOrDeletes(),
623+
greaterThanOrEqualTo(leader.getPrimary().getMaxSeqNoOfUpdatesOrDeletes()));
622624
}
623625
List<Tuple<String, Long>> docAndSeqNosOnFollower = getDocIdAndSeqNos(followingShard).stream()
624626
.map(d -> Tuple.tuple(d.getId(), d.getSeqNo())).collect(Collectors.toList());

0 commit comments

Comments
 (0)