嘿~ 今天天气不错嘛

关于index.translog.durability的疑问

Elasticsearch | 作者 z6883123 | 发布于2020年05月24日 | 阅读数:4412

index.translog.durability有两个参数,request和async,我对这两个参数都不是很理解。
官方文档7.7版本https://www.elastic.co/guide/e ... ml%23
request的解释是
(default) fsync and commit after every request. In the event of hardware failure, all acknowledged writes will already have been committed to disk.
这里是指什么意思啊?是指每个请求都执行一次fsync,可是不是说fsnyc代价大,要放到translog中吗?
然后第二个参数async解释是
fsync and commit in the background every sync_interval. In the event of a failure, all acknowledged writes since the last automatic commit will be discarded.
如果选择了这个参数后又会导致什么变化呢?
看了很久都没搞懂,来论坛问问大家,谢谢了。
已邀请:

byx313 - BLOG:https://www.jianshu.com/u/43fd06f9589c

赞同来自: RangerChen z6883123

fsync:对应系统级别的中的direct I/O,对直接写入到磁盘中,不经过page cache
async:对应系统级别的buffer I/O,会写到page cache,在{index.translog.sync_interval}时间以后会把page cache中的内容再写入到磁盘。比fsync快,但是在index.translog.sync_interval期间机器宕机的话,这些数据没写入到磁盘中,会丢失。

要回复问题请先登录注册