Join GitHub today
Remove `indexing_complete` when removing policy #36620
Context: After synchronous discussion earlier today, @talevy, @eskibars, and I decided that failing loudly when we might possibly be able to succeed is better than being silently surprising, especially when the fix is relatively straightforward.
@martijnvg I requested your review here partially to double-check my thinking here: This setting will be used (in combination with other signals) to indicate to ILM that it is safe to de-follow a following index.
I believe the only case when removing this setting when removing a policy would have an impact is if the policy is removed from an index after it rolls over (and so is actually finished indexing), but a follower has not yet caught up (and therefore has not yet de-followed the index) before the policy is removed.
In this case, the following index will not have this setting set, and so be stuck waiting for this setting to be set. The fix is simply to set this setting manually. Correct?
@colings86 I've added the test you asked for. In the process of writing the test, I ran across a bug: Instead of moving to the error step at https://github.com/elastic/elasticsearch/pull/36620/files#diff-5de660b10fd8979ff41a9ff8d850aaecR569, execution of the policy for this index would start checking for rollover, because we didn't check that the index was actually the write index for the alias.
I've added that check in
Because there's now a slight difference in how those are handled, I've tweaked
It might be worth pulling those changes out into a separate PR, but this PR won't pass without those changes.
This is likely worth discussing when you have time. Also, big thanks to @talevy for helping me figure out the alias gymnastics here!