-
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
Add an API to remove System Indices #62778
Comments
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
Continuing discussion from this comment
Agreed. I've added this issue to the meta issue, and it's something we'll definitely have to address before fully locking down REST access to System Indices - otherwise, we'd see massive numbers of test failures due to test cases not starting from a "clean slate" as they were designed for. That said, we can move forward with deprecation of REST access to System Indices prior to that - if necessary, we can simply ignore the deprecation warning during test cleanup, as long there's a plan to address the issue.
This is great info - and something I think supports the approach of having a (or multiple) "reset" APIs. The goal of the System Indices project as a whole is to make it less likely that users will cause problems in their cluster by accessing indices that are "implementation details" of certain features. Users causing problems by manually deleting the ML indices, which only partially accomplishes their goal, is a very good example of the issues we're trying to solve. |
Another possibility that's been brought up is creating a "test plugin" which exposes an API that emulates the behavior of However, it is not currently clear if this approach would be viable for the Clients tests. I will be reaching out to the Clients team to ask if using such a plugin at test time would be viable for their use case, and update this issue with the conclusion. |
It was just pointed out to me that the Kibana functional tests for ML also need to delete system indices in between tests. I imagine the same might be true for some of the solutions that are Kibana plugins but access system indices. So we'll need to make sure that the solution to this problem is accessible from the Kibana functional test framework as well as client test frameworks. |
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 theSystemIndexPlugin
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.
The text was updated successfully, but these errors were encountered: