The requested URL was not found on this server. 不管你信不信,反正我是没找到

ElasticSearch6.3.2 reroute 迁移某个索引的分片时,如何影响该索引中已删除的文档?

Elasticsearch | 作者 hapjin | 发布于2019年09月27日 | 阅读数:1511

为了简化问题:假设user_v3只有一个分片 shard0,在执行reroute前,使用如下 DELETE  命令删除了很多文档(比如for循环中 doc list 执行下面的删除命令)


DELETE /user_v3/_doc/<_id>


然后接下来执行下面的 reroute 命令:将 node-13上的shard0 迁移到 node-182机器上
POST /_cluster/reroute
{
"commands": [
{
"move": {
"index": "user_v3",
"shard": 0,
"from_node": "node-13",
"to_node": "node-182"
}
}
]
}

我的疑问是:分片reroute后,已删除的文档(执行 DELETE 命令删除),会出现在新节点node-182上吗?
reroute 操作会触发 "merge segment"吗?
 
一些参考资料:lucenes-handling-of-deleted-documents


It is not until segments are merged that the bytes consumed by deleted documents are reclaimed.
 
Deleted documents tie up disk space in the index.


如果没有merge,已删除的文档肯定是会占用磁盘空间的。
 
 


Because deleted documents remain in the index, they must still be decoded from the postings lists and then skipped during searching, so there is added search cost. 


已删除的文档如果还在索引中,那么会占用磁盘空间,而且还会影响搜索性能(decoded from posting lists 会decode 已删除的文档)
 
已邀请:

要回复问题请先登录注册