File tree 2 files changed +13
-0
lines changed
x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -303,6 +303,7 @@ public void clusterChanged(ClusterChangedEvent event) {
303
303
} else {
304
304
// we were the master, and now we aren't
305
305
cancelJob ();
306
+ policyRegistry .clear ();
306
307
}
307
308
}
308
309
Original file line number Diff line number Diff line change @@ -163,6 +163,18 @@ public void delete(Index deleted) {
163
163
cachedSteps .remove (deleted );
164
164
}
165
165
166
+ /**
167
+ * Clear internal maps that were populated by update (and others).
168
+ */
169
+ public void clear () {
170
+ // this is potentially large, so it's important to clear it
171
+ cachedSteps .clear ();
172
+ // these are relatively small, but there's no harm in clearing them
173
+ lifecyclePolicyMap .clear ();
174
+ firstStepMap .clear ();
175
+ stepMap .clear ();
176
+ }
177
+
166
178
/**
167
179
* Return all ordered steps for the current policy for the index. Does not
168
180
* resolve steps using the phase caching, but only for the currently existing policy.
You can’t perform that action at this time.
0 commit comments