Skip to content

Commit

Permalink
Bug fix for applying new routing table
Browse files Browse the repository at this point in the history
Signed-off-by: Bukhtawar Khan <bukhtawa@amazon.com>
  • Loading branch information
Bukhtawar committed Aug 6, 2024
1 parent 84245f0 commit 8d6a402
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class InternalRemoteRoutingTableService extends AbstractLifecycleComponen
private BlobStoreRepository blobStoreRepository;
private final ThreadPool threadPool;
private final String clusterName;

public InternalRemoteRoutingTableService(
Supplier<RepositoriesService> repositoriesService,
Settings settings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1294,10 +1294,11 @@ ClusterState readClusterStateInParallel(
indexRoutingTable -> indicesRouting.put(indexRoutingTable.getIndex().getName(), indexRoutingTable)
);
Diff<RoutingTable> routingTableDiff = readIndexRoutingTableDiffResults.get();
RoutingTable newRoutingTable = new RoutingTable(manifest.getRoutingTableVersion(), indicesRouting);
if (routingTableDiff != null) {
routingTableDiff.apply(previousState.getRoutingTable());
newRoutingTable = routingTableDiff.apply(previousState.getRoutingTable());
}
clusterStateBuilder.routingTable(new RoutingTable(manifest.getRoutingTableVersion(), indicesRouting));
clusterStateBuilder.routingTable(newRoutingTable);

return clusterStateBuilder.build();
}
Expand Down

0 comments on commit 8d6a402

Please sign in to comment.