-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Delete watcher legacy templates #80915
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
Delete watcher legacy templates #80915
Conversation
This adds a way to be able to remove multiple legacy index templates in one cluster state update.
We moved watcher to run on the system indices infrastructure in elastic#67588. This commit makes sure Watcher cleans up the legacy templates it used before it was migrated to system indices.
Pinging @elastic/es-data-management (Team:Data Management) |
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.
Looks good, I left a few comments.
private volatile WatcherService watcherService; | ||
private final EnumSet<WatcherState> stopStates = EnumSet.of(WatcherState.STOPPED, WatcherState.STOPPING); | ||
private final AtomicBoolean legacyTemplatesDeleteInProgress = new AtomicBoolean(false); | ||
private final AtomicBoolean checkForLegacyTemplates = new AtomicBoolean(true); |
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.
Should checking whether a removal of templates is in progress be part of the functionality that MetadataIndexTemplateService.removeTemplates(...)
method offers?
e | ||
); | ||
})); | ||
} |
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.
Should checkForLegacyTemplates
be set to false when existingTemplatesToDelete
list is empty?
* | ||
* The provided templates must exist in the cluster, otherwise an {@link IndexTemplateMissingException} is reported. | ||
*/ | ||
public static void removeTemplates( |
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.
maybe rename to removeLegacyTemplates
? To emphasise this batch removal method is for legacy templates only.
Superseded by #80937 |
This adds a bit of infrastructure to be able to remove multiple legacy templates
with one cluster state update and removes the legacy watcher index templates.
Relates to #80853