# Question about segment merging

**URL:** <https://discuss.elastic.co/t/question-about-segment-merging/110752>\
**Category:** Elasticsearch\
**Created:** [December 7, 2017, 10:01pm UTC](https://discuss.elastic.co/t/question-about-segment-merging/110752 "2017-12-07T22:01:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [December 7, 2017, 10:01pm UTC](https://discuss.elastic.co/t/question-about-segment-merging/110752/1 "2017-12-07T22:01:48Z")

</div>

Hello.

I am trying to understand the Definitive Guide and would appreciate if someone can help me out clarifying my thoughts.

I would like to ask two questions.

[1] In the book it says ,

> **[Making Changes Persistent | Elasticsearch: The Definitive Guide \[2.x\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/guide/current/translog.html)**

> Elasticsearch added a translog, or transaction log, which records every operation in Elasticsearch as it happens. With the translog, the process now looks like this:

In the [segment merging](https://www.elastic.co/guide/en/elasticsearch/guide/current/merge-process.html#merge-process) process, is it first recorded in the translog and then data are flushed to the disk?

[2] If yes, is the number of _operations_ and _size of operation result_ for segment merging included in below section for Node Stats API ?

```
    "translog" : {
      "operations" : 9245364,
      "size_in_bytes" : 10886196986
    },

```

---

<div class="post-metadata">

**Author:** ![thiago](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thiago/32/32096_2.png) [@thiago](https://discuss.elastic.co/u/thiago)\
**Post date:** [December 10, 2017, 1:18pm UTC](https://discuss.elastic.co/t/question-about-segment-merging/110752/2 "2017-12-10T13:18:03Z")

</div>

Writing to the translog and segment merging are completely disconnected operations.

Every write operation is written to translog when it's received while segment merging is a different operation that works in the background.

The merging operations does not involves writting to translog. At most, it's all the way around.

---

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [December 10, 2017, 5:46pm UTC](https://discuss.elastic.co/t/question-about-segment-merging/110752/3 "2017-12-10T17:46:02Z")

</div>

@thiago

Understood. Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2018, 5:46pm UTC](https://discuss.elastic.co/t/question-about-segment-merging/110752/4 "2018-01-07T17:46:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
