Skip to content

Commit

Permalink
Exclude search replicas from sync
Browse files Browse the repository at this point in the history
Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi committed Oct 24, 2024
1 parent ad7f9e7 commit 90bf8bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public ReplicationGroup(
assert shard.primary() == false : "primary shard should not be unassigned in a replication group: " + shard;
skippedShards.add(shard);
} else {
if (trackedAllocationIds.contains(shard.allocationId().getId())) {
if (trackedAllocationIds.contains(shard.allocationId().getId()) && !shard.isSearchOnly()) {
replicationTargets.add(shard);
} else {
assert inSyncAllocationIds.contains(shard.allocationId().getId()) == false : "in-sync shard copy but not tracked: "
Expand All @@ -86,7 +86,7 @@ public ReplicationGroup(
}
if (shard.relocating()) {
ShardRouting relocationTarget = shard.getTargetRelocatingShard();
if (trackedAllocationIds.contains(relocationTarget.allocationId().getId())) {
if (trackedAllocationIds.contains(relocationTarget.allocationId().getId()) && !relocationTarget.isSearchOnly()) {
replicationTargets.add(relocationTarget);
} else {
skippedShards.add(relocationTarget);
Expand Down

0 comments on commit 90bf8bb

Please sign in to comment.