File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
server/src/main/java/org/elasticsearch/ingest Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -298,16 +298,16 @@ public void clusterChanged(ClusterChangedEvent event) {
298298 .map (p -> (SamplingMetadata ) p .custom (SamplingMetadata .TYPE ))
299299 .map (SamplingMetadata ::getIndexToSamplingConfigMap )
300300 .orElse (Map .of ());
301- Set <String > removedIndexNames = new HashSet <>(oldSampleConfigsMap .keySet ());
302- removedIndexNames .removeAll (newSampleConfigsMap .keySet ());
301+ Set <String > indicesWithRemovedConfigs = new HashSet <>(oldSampleConfigsMap .keySet ());
302+ indicesWithRemovedConfigs .removeAll (newSampleConfigsMap .keySet ());
303303 /*
304304 * These index names no longer have sampling configurations associated with them. So we remove their samples. We are OK
305305 * with the fact that we have a race condition here -- it is possible that in maybeSample() the configuration still
306306 * exists but before the sample is read from samples it is deleted by this method and gets recreated. In the worst case
307307 * we'll have a small amount of memory being used until the sampling configuration is recreated or the TTL checker
308308 * reclaims it. The advantage is that we can avoid locking here, which could slow down ingestion.
309309 */
310- for (String indexName : removedIndexNames ) {
310+ for (String indexName : indicesWithRemovedConfigs ) {
311311 logger .debug ("Removing sample info for {} because its configuration has been removed" , indexName );
312312 samples .remove (new ProjectIndex (projectId , indexName ));
313313 }
You can’t perform that action at this time.
0 commit comments