Skip to content

Commit

Permalink
Removing unintended changes
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 26, 2024
1 parent c517504 commit eeb31d1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected void performOnReplicaProxy(
BiConsumer<Consumer<ActionListener<ReplicaResponse>>, ReplicationProxyRequest<ReplicaRequest>> performOnReplicaConsumer
) {
assert replicationMode == ReplicationMode.FULL_REPLICATION || replicationMode == ReplicationMode.PRIMARY_TERM_VALIDATION;

Consumer<ActionListener<ReplicaResponse>> replicasProxyConsumer;
if (replicationMode == ReplicationMode.FULL_REPLICATION) {
replicasProxyConsumer = getReplicasProxyConsumer(fullReplicationProxy, proxyRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -878,5 +878,4 @@ public boolean unassignedReasonIndexCreated() {
}
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ public ReplicationTracker(
final LongSupplier currentTimeMillisSupplier,
final BiConsumer<RetentionLeases, ActionListener<ReplicationResponse>> onSyncRetentionLeases,
final Supplier<SafeCommitInfo> safeCommitInfoSupplier,
final Function<String, Boolean> checkForRemoteDiscoveryNode
final Function<String, Boolean> isShardOnRemoteEnabledNode
) {
this(
shardId,
Expand All @@ -1015,7 +1015,7 @@ public ReplicationTracker(
onSyncRetentionLeases,
safeCommitInfoSupplier,
x -> {},
checkForRemoteDiscoveryNode
isShardOnRemoteEnabledNode
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,14 @@ public void testReplicationWithRemoteTranslogEnabled() throws Exception {
ShardRoutingState.STARTED,
primaryId
);
initializingIds.forEach(aId -> {
builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.INITIALIZING, aId));
});
activeIds.stream().filter(aId -> !aId.equals(primaryId)).forEach(aId -> {
builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.INITIALIZING, aId));
});
initializingIds.forEach(
aId -> builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.INITIALIZING, aId))
);
activeIds.stream()
.filter(aId -> !aId.equals(primaryId))
.forEach(
aId -> builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.STARTED, aId))
);
builder.addShard(primaryShard);
IndexShardRoutingTable routingTable = builder.build();

Expand Down Expand Up @@ -276,12 +278,12 @@ public void testPrimaryToPrimaryReplicationWithRemoteTranslogEnabled() throws Ex
ShardRoutingState.RELOCATING,
primaryId
);
initializingIds.forEach(aId -> {
builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.INITIALIZING, aId));
});
activeIds.forEach(aId -> {
builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.STARTED, aId));
});
initializingIds.forEach(
aId -> builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.INITIALIZING, aId))
);
activeIds.forEach(
aId -> builder.addShard(newShardRouting(shardId, nodeIdFromAllocationId(aId), null, false, ShardRoutingState.STARTED, aId))
);
builder.addShard(primaryShard);
IndexShardRoutingTable routingTable = builder.build();

Expand Down

0 comments on commit eeb31d1

Please sign in to comment.