From 8bfa6c4d9d59f1b608ce525090de7740cb027bdb Mon Sep 17 00:00:00 2001 From: Kiran Prakash Date: Fri, 12 Apr 2024 10:34:01 -0700 Subject: [PATCH] Update IndicesRequestCache.java Signed-off-by: Kiran Prakash --- .../java/org/opensearch/indices/IndicesRequestCache.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java index 3ee57fdb7efff..d4ea8fc0c2c88 100644 --- a/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java +++ b/server/src/main/java/org/opensearch/indices/IndicesRequestCache.java @@ -515,8 +515,9 @@ private void updateStaleCountOnEntryRemoval(CleanupKey cleanupKey, RemovalNotifi return; } if (cleanupKey.entity == null) { - // on shard close, the shard is still lying around so this will only happen when the shard is deleted. - // we would have accounted this in staleKeysCount when the deletion of shard would have closed the associated readers + // entity will only be null when the shard is closed/deleted + // we would have accounted this in staleKeysCount when the closing/deletion of shard would have closed the associated + // readers staleKeysCount.decrementAndGet(); return; }