Skip to content

Commit a2fda5a

Browse files
committed
Drop this assert
It doesn't work as written because it expects the cachedSteps map to be the same between the call to the put and the call to getCachedStep -- but of course another thread could have put a new policy, which results in PolicyStepsRegistry#update being called and the cache being cleared (in which case the second call returns null).
1 parent af7fb2b commit a2fda5a

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistry.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,6 @@ public Step getStep(final IndexMetadata indexMetadata, final Step.StepKey stepKe
368368
final Step s = phaseSteps.stream().filter(step -> step.getKey().equals(stepKey)).findFirst().orElse(null);
369369
if (s != null) {
370370
cachedSteps.put(indexMetadata.getIndex(), Tuple.tuple(indexMetadata, s));
371-
// assert that the cache works as expected -- that is, if we put something into the cache,
372-
// we should get back the same thing if we were to invoke getStep again with the same arguments
373-
Step found = getCachedStep(indexMetadata, stepKey);
374-
assert s == found : "policy step registry cache failed sanity check (expected [" + s + "], found [" + found + "])";
375371
}
376372
return s;
377373
}

0 commit comments

Comments
 (0)