可以在使用克隆API后删除源索引吗?

huangapple go评论107阅读模式
英文:

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

硬链接是原始文件的镜像副本,所以

  1. 是的
  2. 不是,因为它已经被复制了
  3. 不是,如果你删除了旧的索引,原始段已经消失了,但由于它们已经被复制到新的索引中,所以没问题。

很容易测试;-)

英文:

A hard link is a mirror copy of the original file, so

  1. Yes
  2. No, because it has been copied
  3. 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 可以在使用克隆API后删除源索引吗?

huangapple
  • 本文由 发表于 2023年7月20日 16:26:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/76727987.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定