Why cannot restore index from snapshot if an open index with same name exists in the cluster?

Why cannot restore index from snapshot if an open index with same name exists in the cluster?

In Elasticsearch Source Code server/src/main/java/org/elasticsearch/snapshots/RestoreService.java method validateExistingIndex, there is a TODO that // TODO: Enable restore for open indices.
If I want to create snapshot incrementally from a cluster, and only restore index in another cluster, can I change the index exist checking?

Are you looking at syncing continuously 2 clusters? If it's the case, I'd look at:

I think it requires a platinum license. But you can activate a trial super easily from Kibana.

Thank you very much. I also want to know why I need to close the exists index before restore on it.

The answer is the comment you quoted:

i.e. it's not done yet :wink:

Restoring into an open index would be really complicated to implement, because the restore needs to replace the underlying files. Doing that while closed is simpler since those files aren't in use, but if the index were open then we can't simply replace them. Also we'd need to do the restore on all the replicas at the same time, rather than today's process which only happens on the primary.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.