-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Description
Currently it isn't possible to restore a data stream in a cluster that already has a data stream with the same name.
We do support restoring indices with the same name in a cluster. In order for that to work the indices to be restored
need to be closed. This is currently an issue for data streams, since the write index of a data stream is not allowed to be closed.
When restoring an entire snapshot (with all indices, global state) into an existing cluster this is problematic, since that entire operation will fail if there are data streams part of the cluster. So I think we should find a way to support restoring data streams in place in a similar way indices can be restored in place.
The reason closing a write index is not allowed, is to ensure that a data stream always can accept writes. For the same reason deleting a write index is not allowed (the write index can only be deleted when deleting the entire data stream).
The question is here is that maybe we should allow a write index to be closed. If that happens then the data stream wouldn't be accepting writes, but it can easily be restored by executing an open index request. So isn't destructive to a data stream and it temporarily disables writing into a data stream. If we would allow closing/opening a data stream then the restoring a data stream in place is possible. Also other administrative operations that can only be done on a closed index are then also possible.
I'm not sure if there are other restrictions or reasons to not allow replacing a data stream in place. Currently I only see the validation that prevents closing a write index as a reason why currently we can't support this. However if there are other reasons then let's discuss these here too.