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 6b59c82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions gradle/run.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ testClusters {
plugin('plugins:'.concat(p))
}
}
setting 'opensearch.experimental.feature.read.write.split.enabled', 'true'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public ReplicationGroup(
skippedShards.add(shard);
} else {
if (trackedAllocationIds.contains(shard.allocationId().getId())) {
replicationTargets.add(shard);
if (!shard.isSearchOnly()) {
replicationTargets.add(shard);
}
} else {
assert inSyncAllocationIds.contains(shard.allocationId().getId()) == false : "in-sync shard copy but not tracked: "
+ shard;
Expand All @@ -87,7 +89,9 @@ public ReplicationGroup(
if (shard.relocating()) {
ShardRouting relocationTarget = shard.getTargetRelocatingShard();
if (trackedAllocationIds.contains(relocationTarget.allocationId().getId())) {
replicationTargets.add(relocationTarget);
if (!relocationTarget.isSearchOnly()) {
replicationTargets.add(relocationTarget);
}
} else {
skippedShards.add(relocationTarget);
assert inSyncAllocationIds.contains(relocationTarget.allocationId().getId()) == false
Expand Down

0 comments on commit 6b59c82

Please sign in to comment.