-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Handle dangling indices more safely #48366
Comments
Pinging @elastic/es-distributed (:Distributed/Distributed) |
Introduce a new static setting, `gateway.auto_import_dangling_indices`, which prevents dangling indices from being automatically imported. Part of #48366.
Introduce a new static setting, `gateway.auto_import_dangling_indices`, which prevents dangling indices from being automatically imported. Part of #48366.
@ywelsch / @DaveCTurner what do you think the behaviour should be in the |
By default I think we should import the latest version of the index metadata that we can find. The metadata version number is not wholly trustworthy when it's detached from the cluster metadata, but it's close enough IMO. |
…tic#49174) Introduce a new static setting, `gateway.auto_import_dangling_indices`, which prevents dangling indices from being automatically imported. Part of elastic#48366.
Part of #48366. Implement an API for listing, importing and deleting dangling indices. Co-authored-by: David Turner <david.turner@elastic.co>
The dangling_indices.import API name could cause issues in the client libs because import is a reserved word in many languages. Rename the API to avoid this, and rename the other APIs for consistency. Related to #48366.
The dangling_indices.import API name could cause issues in the client libs because import is a reserved word in many languages. Rename the API to avoid this, and rename the other APIs for consistency. Related to #48366.
Part of elastic#48366. Now that there is a dedicated API for dangling indices, the auto-import behaviour can default to off.
Part of #48366. Now that there is a dedicated API for dangling indices, the auto-import behaviour can default to off.
Part of elastic#48366. Now that there is a dedicated API for dangling indices, the auto-import behaviour can default to off.
Closes #48366. Remove all traces of automatically importing dangling indices. This functionality is deprecated from 7.9.0.
Dangling indices are indices that exist on disk on one or more nodes but which do not currently exist in the cluster state. They arise in a number of situations, such as:
Today we greedily and automatically import any dangling indices found on disk if possible, with surprising results:
What can we do about this?
In the long run we would prefer to avoid auto-importing dangling indices, but we must recognise that there are some desperate situations where a dangling index import is the best option and must therefore continue to support it. Rather than automatically importing a dangling index as soon as it is discovered, we could offer an API to help users manage their dangling indices. Something like this:
Gets a list of the dangling indices across the cluster. The response could include the index metadata (the one with the highest version in case of conflict) and mappings and some information about the underlying shards to help the user decide whether it should be deleted without needing to import it first.
Marks the dangling index for deletion.
Imports the given index into the cluster. This would require a body with
accept_data_loss: true
. It may be necessary to allow dangling indices to be recovered under a different name too. Maybe we should allow specifying a particular node in case of conflicting metadata versions.It should also be possible to use a wildcard i.e.
POST /_dangling/*
, so that if a user is in a desperate situation, they can still quickly import any dangling indices without having to iterate over the whole list.With this API we would warn the user about the existence of dangling indices through some UI (e.g. periodic log messages, or something in Kibana) and it would then be up to them to resolve that warning at their convenience.
The API sketch above is predicated on being able to disable the automatic import of dangling indices. We propose to introduce a new setting, which will default to disabling automatic imports. At a later date we will remove the setting, along with the automatic imports functionality since it is inherently unsafe.
Steps
v8.0.0
The text was updated successfully, but these errors were encountered: