From 62b00582cf2a6d463253d65c59991a3d6ae9c60a Mon Sep 17 00:00:00 2001 From: Sagar Upadhyaya Date: Mon, 8 Jan 2024 14:56:05 -0800 Subject: [PATCH] Reverting to old changes for indices map Signed-off-by: Sagar Upadhyaya --- .../src/main/java/org/opensearch/indices/IndicesService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/indices/IndicesService.java b/server/src/main/java/org/opensearch/indices/IndicesService.java index 4b2f823014f82..23ae13966eda8 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesService.java +++ b/server/src/main/java/org/opensearch/indices/IndicesService.java @@ -178,7 +178,6 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -194,6 +193,7 @@ import java.util.stream.Collectors; import static java.util.Collections.emptyList; +import static java.util.Collections.emptyMap; import static java.util.Collections.unmodifiableMap; import static org.opensearch.common.collect.MapBuilder.newMapBuilder; import static org.opensearch.common.util.concurrent.OpenSearchExecutors.daemonThreadFactory; @@ -333,7 +333,7 @@ public class IndicesService extends AbstractLifecycleComponent private final ScriptService scriptService; private final ClusterService clusterService; private final Client client; - private Map indices = new ConcurrentHashMap<>(); + private volatile Map indices = emptyMap(); private final Map> pendingDeletes = new HashMap<>(); private final AtomicInteger numUncompletedDeletes = new AtomicInteger(); private final OldShardsStats oldShardsStats = new OldShardsStats();