-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
As part of formalizing System Indices in Elasticsearch (#50251), we will be restricting access to System Indices via the REST interface, except by means of purpose-built APIs. As has been raised in #62501, this will require a new API to remove System Indices, for the purposes of cleanup between tests if nothing else. We also believe that this will be of use to end users, who may wish to "reset" features which store configuration or other information in system indices.
Simply deleting all System Indices is not sufficient to accomplish this goal without causing other problems. Some features store information for "in flight" tasks in their associated System Indices, for example. Because different features may have different requirements, it may be desirable to add several APIs, rather than a single one.
One way to implement this would be to simply have each plugin add a _reset (or similar) API endpoint which performs whatever tasks are required to clean that plugin's indices/tasks/etc.
Another way would be to add a resetSystemIndices() method to the SystemIndexPlugin interface, which is required to clean up all System Indices owned by that plugin, as well as any other tasks (or provide a callback to do so, etc.). This could be called from a central "factory reset" API.
The two options are not mutually exclusive, either. Whatever the implementation, this reset logic should be owned by the team which owns the plugin in question, in order to ensure that the cleanup is complete and kept up to date with changes to the plugin.