Skip to content

Commit

Permalink
Removing redundant calls to isRemoteTranslogEnabled
Browse files Browse the repository at this point in the history
Signed-off-by: Shourya Dutta Biswas <[email protected]>
  • Loading branch information
shourya035 committed Mar 21, 2024
1 parent 50cb08a commit 8aabf1a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ protected long primaryOperationSize(BulkShardRequest request) {

@Override
public ReplicationMode getReplicationMode(IndexShard indexShard) {
if (indexShard.isRemoteTranslogEnabled() || indexShard.routingEntry().isAssignedToRemoteStoreNode()) {
if (indexShard.routingEntry().isAssignedToRemoteStoreNode()) {
return ReplicationMode.PRIMARY_TERM_VALIDATION;
}
return super.getReplicationMode(indexShard);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public void performOn(
* @return the overridden replication mode.
*/
public ReplicationMode getReplicationMode(IndexShard indexShard) {
if (indexShard.isRemoteTranslogEnabled() || indexShard.routingEntry().isAssignedToRemoteStoreNode()) {
if (indexShard.routingEntry().isAssignedToRemoteStoreNode()) {
return ReplicationMode.NO_REPLICATION;
}
return ReplicationMode.FULL_REPLICATION;
Expand Down Expand Up @@ -642,7 +642,7 @@ public void handleException(TransportException exp) {
primaryRequest.getPrimaryTerm(),
initialRetryBackoffBound,
retryTimeout,
indexShard.isRemoteTranslogEnabled() || indexShard.indexSettings().isRemoteNode()
indexShard.routingEntry().isAssignedToRemoteStoreNode()
? new ReplicationModeAwareProxy<>(getReplicationMode(indexShard), replicasProxy, termValidationProxy)
: new FanoutReplicationProxy<>(replicasProxy)
).execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ private void addPeerRecoveryRetentionLeaseForSolePrimary() {
final String leaseId = getPeerRecoveryRetentionLeaseId(primaryShard);
if (retentionLeases.get(leaseId) == null) {
if (replicationGroup.getReplicationTargets().equals(Collections.singletonList(primaryShard))
|| indexSettings().isRemoteTranslogStoreEnabled()) {
|| indexSettings().isRemoteTranslogStoreEnabled() || primaryShard.isAssignedToRemoteStoreNode()) {
assert primaryShard.allocationId().getId().equals(shardAllocationId) : routingTable.assignedShards()
+ " vs "
+ shardAllocationId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected void doExecute(Task task, PublishCheckpointRequest request, ActionList

@Override
public ReplicationMode getReplicationMode(IndexShard indexShard) {
if (indexShard.isRemoteTranslogEnabled() || indexShard.routingEntry().isAssignedToRemoteStoreNode()) {
if (indexShard.routingEntry().isAssignedToRemoteStoreNode()) {
return ReplicationMode.FULL_REPLICATION;
}
return super.getReplicationMode(indexShard);
Expand Down

0 comments on commit 8aabf1a

Please sign in to comment.