Translog durability (Elasticsearch) 翻译为:事务日志持久性(Elasticsearch)

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

Translog durability (Elasticsearch)

问题

我已阅读来自ElasticSearch官方文档关于translog的内容,但未找到以下问题的答案。我尝试在其他地方寻找答案,但未能找到答案。
在文档中提到index.translog.durability=request的含义是:

(默认)在每个请求后进行fsync和提交。在硬件故障的情况下,所有已确认的写操作已经提交到磁盘上。

这里提到的提交是指Lucene提交吗?Lucene提交很昂贵,正因为如此才引入了translog。那么为什么这个属性的默认值是request呢?它应该是异步的。

英文:

I have read about translog from ElasticSearch official doc but I didn't get answer to below question. I tried to find-out at other places but not able to find the answer.
In doc it is mentioned for index.translog.durability=request means

(default) fsync and commit after every request. In the event of hardware failure, all acknowledged writes will already have been committed to disk.

here mentioned commit is Lucene commit? Lucene commit is expensive & due to this only translog is introduced. then why default value of this property is request. It should be async

答案1

得分: 1

Translog commit 是磁盘提交(将一些日志附加到文件),而不是 Lucene 提交。

Translog 是许多数据库中确保耐用性的常见方式,如 MySQL、Elasticsearch、Redis。

在将请求写入 Lucene 索引之前,它将被写入 Translog。如果前者失败(例如,Elasticsearch 服务器宕机),当您重新启动 Elasticsearch 服务器时,它将重放 Translog。

  1. 此属性的默认值是 request,这意味着 Translog 会按请求提交到磁盘,确保最高的耐久性。

  2. 另一方面,async 意味着在一段时间后(index.translog.sync_interval),Translog 将提交到磁盘。这提高了性能,但耐久性较低。

英文:

Translog commit is a disk commit(append some log to a file), not a Lucene commit.

Translog is a common way to ensure durability in many databases, like mysql, elasticsearch, redis.

Before a request is written to a lucene index, it will be written into translog. If the former failed (for example, elasticsearch server is down),
when you restart elasticsearch server, it will replay the translog.

  1. The default value of this property is request, which means translog is committed to disk by request. It ensures highest durablity.

  2. One the other hand, async means after some period (index.translog.sync_interval), translog will commit to disk. It imporves performance, with lower durablity.

huangapple
  • 本文由 发表于 2023年5月11日 10:07:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76223672.html
匿名

发表评论

匿名网友

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

确定