-
Notifications
You must be signed in to change notification settings - Fork 25k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid making the index read-only in the Force merge action for ILM (Closes #43426) #81162
Avoid making the index read-only in the Force merge action for ILM (Closes #43426) #81162
Conversation
Pinging @elastic/es-data-management (Team:Data Management) |
@elasticmachine OK to test |
This is slightly different than what we discussed in #53289 (comment), which is that we would remove making the index read-only automatically, leaving it up to the user to add the |
Oh I see, then the idea is that |
Yep, that's correct! |
@dakrone I made the corresponding changes and the checks seem good. Let me know what you think and I was wondering what's the earliest version in which we could get this, thanks! |
@elasticmachine update branch |
@elasticmachine ok to test |
Sorry for the delay on this, I've been doing some manual testing and an issue that I suspected we might run into does indeed happen to be the case. When we remove a step from an action (
I'd like to figure out how we should handle things like this, because we can easily fall into this when we make subtractive changes (additive changes are no problem) to the steps executed for an action. |
@dakrone oh wow great catch! One idea that I can think of is to add the |
One thing we could think about is substituting it for a "noop" step with the same stepkey as the previous step, this would allow us to remove its action, but still have it "execute" by doing nothing for those particular steps that were removed. I'll experiment a little bit with this. I think combining it with the un-referenced idea you have @jcbages might work also. |
Hi, is this still in progress? We are very interested in this change as the enforced read-only prevents us from using ILM for our use case. |
Hi @dakrone, wondering if you were able to test the idea you mention or if you want me to try it and report results so we can make the required changes for merging this |
Hey @jcbages, sorry for the delay on this, thanks for being patient! I spent some time brainstorming with @andreidan about how to fix this. I think we can do it, but instead of removing the step, we'll keep the step (and its stepkey) in the Does that make sense? Is this something you're still interested in working on, or would you prefer that we do it? |
Hi @dakrone, thanks for your answer. Yeah I think I understand the idea and I'm still very interested in working on so I'll follow up with some commits that should address this soon. |
Hi @dakrone, I was just able to resume this and I added the changes we discussed regarding the no-op step with the read-only key. Let me know how it looks to you and if you could reproduce the case in which the index got stuck to validate if this is not happening anymore it'd be great! |
…ng passed to forcemergeaction constructor
…donly forcemerge was applied
…ly settings always
…only forcemerge steps
…ility whenever we change the functionality of a step
…tep with the readonlykey
Hi @dakrone thanks for the comments! I already addressed them and tested the ILM is not getting stuck in readonly step. Let me know if you think there's something else to change and thanks for all your help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for iterating on this @jcbages, I left one more comment, but then I will merge this in.
* It literally does nothing so that we can safely proceed to the nextStepKey without getting stuck. | ||
*/ | ||
public class NoopStep extends ClusterStateWaitStep { | ||
public static final String NAME = "NOOP"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of our step names are lowercased
public static final String NAME = "NOOP"; | |
public static final String NAME = "noop"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dakrone thanks! I applied to suggestion so now the NAME is in lowercase
Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
Hi @dakrone, I made the change for your last comment and we got a clean build so we should be good to merge! |
Added a new
NoopStep
that we can use as a placeholder for a step that we had in a previous version but now we want to remove it. If the just go and erase the step then the indices that were in that step will get into a stuck state. Instead, we're using the same old step key but with thisNoopStep
which does nothing but the transition to the next step.Modify the
ForceMergeLifecycleAction
in ILM so it doesn't make the indexread-only
. For older indices already in the "convert index to read-only" step before the upgrade, we'll use theNoopStep
mentioned before in order to ignore the step and just transition to the next one.Solves: #43426