# When will translog file be deleted from disk?

**URL:** <https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944>\
**Category:** Elasticsearch\
**Created:** [March 22, 2021, 6:28am UTC](https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944 "2021-03-22T06:28:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![CHU\_XU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chu_xu/32/45946_2.png) [@CHU\_XU](https://discuss.elastic.co/u/CHU_XU)\
**Post date:** [March 22, 2021, 6:28am UTC](https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944/1 "2021-03-22T06:28:25Z")

</div>

Hi there,

I found in the data directory, there many translog files like \*.tlog or \*.ckp have been existing for few days.  
According to the document, there's a retention setting with default 12 hours. But I'm using 7.5 version and this setting is deprecated.  
How can I have those translog files committed to lucene index and be deleted?  
Actually for some reason I want to have translog files exist for no longer than 24 hours.

Thanks

---

<div class="post-metadata">

**Author:** ![CHU\_XU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chu_xu/32/45946_2.png) [@CHU\_XU](https://discuss.elastic.co/u/CHU_XU)\
**Post date:** [March 22, 2021, 6:39am UTC](https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944/2 "2021-03-22T06:39:06Z")

</div>

BTW, those translog files seems empty because file size is only few bytes.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [March 22, 2021, 7:48am UTC](https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944/3 "2021-03-22T07:48:32Z")

</div>

Translog files are cleaned up when they're no longer necessary, typically on a flush as long as the flush has other work to do. However the version you're using has a [bug](https://github.com/elastic/elasticsearch/issues/49970) which creates empty translog files on a restart; these empty translog files will be cleaned up on the first nontrivial flush, but that could be days (or months) later if it ever happens. The [fix](https://github.com/elastic/elasticsearch/pull/51905) is in 7.7.0 so you should upgrade. A temporary workaround is to `POST /<INDEXNAME>/_flush?force`.

---

<div class="post-metadata">

**Author:** ![CHU\_XU](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chu_xu/32/45946_2.png) [@CHU\_XU](https://discuss.elastic.co/u/CHU_XU)\
**Post date:** [March 22, 2021, 8:02am UTC](https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944/4 "2021-03-22T08:02:27Z")

</div>

Thanks David.

---

<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:** [April 19, 2021, 8:02am UTC](https://discuss.elastic.co/t/when-will-translog-file-be-deleted-from-disk/267944/5 "2021-04-19T08:02:41Z")

</div>

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