英文:
Deleting source index after using the clone API possible?
问题
弹性克隆 API(https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clone-index.html)说明如下:
> 克隆的工作方式如下:
> - 首先,它创建一个与源索引相同定义的新目标索引。
> - 然后,它将源索引的段硬链接到目标索引中。(如果文件系统不支持硬链接,则所有段都会复制到新索引中,这是一个更耗时的过程。)
> - 最后,它将目标索引恢复为一个刚刚重新打开的已关闭索引。
如果文档被硬链接,如果我通过删除 API 删除旧的源索引会发生什么?
- 硬链接的段是否会被复制到新索引数据目录?
- 数据会丢失吗?
- 硬链接的段是否只保留在磁盘上的原始位置?
英文:
The elastic clone api (https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clone-index.html) states
> Cloning works as follows:
> - First, it creates a new target index with the same definition as the source index.
> - Then it hard-links segments from the source index into the target index. (If the file system doesn’t support hard-linking, then all segments are copied into the new index, which is a much more time consuming process.)
> - Finally, it recovers the target index as though it were a closed index which had just been re-opened.
If documents are hard-linked, what happens if I delete the old source index via the delete API?
- Are the hard-linked segments copied to the new index data directory?
- Is the data lost?
- Are the hard-linked segments just kept in their original location on disk?
答案1
得分: 1
硬链接是原始文件的镜像副本,所以
- 是的
- 不是,因为它已经被复制了
- 不是,如果你删除了旧的索引,原始段已经消失了,但由于它们已经被复制到新的索引中,所以没问题。
很容易测试;-)
英文:
A hard link is a mirror copy of the original file, so
- Yes
- No, because it has been copied
- No, if you delete the old index, the original segments are gone, but since they have been copied into your new index, you're fine.
It's easy to test
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论