Storing new elasticsearch documents while restoring an index

Hi there,

I have a question about storing new documents in an indexed that is being restored. Is such a thing possible? My use case is that we have a large index that will be restored, but upon restoring the index we have a different process that will periodically insert new documents into that index as well. I can't figure out via the documentation if the index that is being restored is being set to read-only for example or not.

If anyone has input on this, it would be much appreciated!

Restoring an index from snapshot works on a shard-by-shard basis and, for each shard, takes place entirely before the primary of that shard is started. You cannot write to a shard (or search it) before its primary is started. Attempts to do so will wait for the shard to start, up to 60 seconds by default I think, and then fail. However, because the shards are all restored independently it may be possible to write to some of the shards before the others are started.

I think you can yourself set the whole index to be read-only when you start the restore process by including "index.blocks.read_only":true in the index settings. Once the whole index has been restored you can then remove this block to allow writes.

Thanks for the reply David, much appreciated!

1 Like

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