mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Fix testGlobalCheckpointSync
The test needed adaption after #43205, as the ReplicationTracker now distinguishes between the knowledge of the persisted global checkpoint and the computed global checkpoint on the primary Follow-up to #43205
This commit is contained in:
parent
a76c034866
commit
e04a2258fc
@ -1117,11 +1117,14 @@ public class IndexShardTests extends IndexShardTestCase {
|
|||||||
final String replicaAllocationId = replicaShard.routingEntry().allocationId().getId();
|
final String replicaAllocationId = replicaShard.routingEntry().allocationId().getId();
|
||||||
primaryShard.updateLocalCheckpointForShard(replicaAllocationId, replicaLocalCheckpoint);
|
primaryShard.updateLocalCheckpointForShard(replicaAllocationId, replicaLocalCheckpoint);
|
||||||
|
|
||||||
// initialize the local knowledge on the primary of the global checkpoint on the replica shard
|
// initialize the local knowledge on the primary of the persisted global checkpoint on the replica shard
|
||||||
final int replicaGlobalCheckpoint = randomIntBetween(Math.toIntExact(SequenceNumbers.NO_OPS_PERFORMED),
|
final int replicaGlobalCheckpoint = randomIntBetween(Math.toIntExact(SequenceNumbers.NO_OPS_PERFORMED),
|
||||||
Math.toIntExact(primaryShard.getLastKnownGlobalCheckpoint()));
|
Math.toIntExact(primaryShard.getLastKnownGlobalCheckpoint()));
|
||||||
primaryShard.updateGlobalCheckpointForShard(replicaAllocationId, replicaGlobalCheckpoint);
|
primaryShard.updateGlobalCheckpointForShard(replicaAllocationId, replicaGlobalCheckpoint);
|
||||||
|
|
||||||
|
// initialize the local knowledge on the primary of the persisted global checkpoint on the primary
|
||||||
|
primaryShard.updateGlobalCheckpointForShard(shardRouting.allocationId().getId(), primaryShard.getLastKnownGlobalCheckpoint());
|
||||||
|
|
||||||
// simulate a background maybe sync; it should only run if the knowledge on the replica of the global checkpoint lags the primary
|
// simulate a background maybe sync; it should only run if the knowledge on the replica of the global checkpoint lags the primary
|
||||||
primaryShard.maybeSyncGlobalCheckpoint("test");
|
primaryShard.maybeSyncGlobalCheckpoint("test");
|
||||||
assertThat(
|
assertThat(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user