# Translog has incomplete operation written for large documents

**URL:** <https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997>\
**Category:** Elasticsearch\
**Created:** [October 12, 2015, 9:51am UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997 "2015-10-12T09:51:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahathi](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Mahathi](https://discuss.elastic.co/u/Mahathi)\
**Post date:** [October 12, 2015, 9:51am UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/1 "2015-10-12T09:51:51Z")

</div>

Hi,

We are using ElasticSearch 1.3.4 on Windows Azure IaaS VMs (using storage accounts/disks to house the actual data) and have seen this happen couple of times. The translog file fails to recover, with the following error, and when we dig deeper into the translog file, it seems like one of the document we wanted to add was really large (around 4 MB) and it seems like only part of the file was indexed, and the next document entry starts from there. This causes the version mismatch error as its trying to interpret the translog.

Question:

1. What guarantees exist in terms of translog operation entries being written atomically? Is it possible that for large files we can potentially hit this more often and something we should expect?
2. Is there an easier workaround than deleting the translog-\*.recovering files, because that will require re-indexing all the affected docs again.

org.elasticsearch.index.gateway.IndexShardGatewayRecoveryException: [index\_1][6] failed to recover shard  
at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:269)  
at org.elasticsearch.index.gateway.IndexShardGatewayService$1.run(IndexShardGatewayService.java:132)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:724)  
Caused by: org.elasticsearch.ElasticsearchException: failed to read [MyFileContract][XXX@FileName]  
at org.elasticsearch.index.translog.Translog$Index.readFrom(Translog.java:511)  
at org.elasticsearch.index.translog.TranslogStreams.readTranslogOperation(TranslogStreams.java:52)  
at org.elasticsearch.index.gateway.local.LocalIndexShardGateway.recover(LocalIndexShardGateway.java:241)  
... 4 more  
Caused by: org.elasticsearch.ElasticsearchIllegalArgumentException: No version type match [48]  
at org.elasticsearch.index.VersionType.fromValue(VersionType.java:307)  
at org.elasticsearch.index.translog.Translog$Index.readFrom(Translog.java:508)  
... 6 more

Any leads or pointers to get further into debugging this would be great,

Thanks!

---

<div class="post-metadata">

**Author:** ![Mahathi](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Mahathi](https://discuss.elastic.co/u/Mahathi)\
**Post date:** [October 15, 2015, 11:33am UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/2 "2015-10-15T11:33:42Z")

</div>

Any inputs would be helpful here? We have hit this a couple of times till now, and not sure how to progress on the same.

Thanks again!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 15, 2015, 8:23pm UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/3 "2015-10-15T20:23:40Z")

</div>

1. It's for each shard and for each operation, so it's atomic as possible. What do you mean by large files?
2. Finding the underlying issue and fixing that. Perhaps turning on debug logging will help? Can you upgrade?

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [December 27, 2015, 10:42am UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/4 "2015-12-27T10:42:16Z")

</div>

@warkolm - By upgrade u mean to 2.1?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 27, 2015, 8:06pm UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/5 "2015-12-27T20:06:05Z")

</div>

At least off 1.3.X, there's way too many improvements between there and now.

---

<div class="post-metadata">

**Author:** ![mosiddi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mosiddi/32/577_2.png) [@mosiddi](https://discuss.elastic.co/u/mosiddi)\
**Post date:** [December 28, 2015, 3:30am UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/6 "2015-12-28T03:30:46Z")

</div>

thanks!

---

<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:** [July 5, 2017, 11:28pm UTC](https://discuss.elastic.co/t/translog-has-incomplete-operation-written-for-large-documents/31997/7 "2017-07-05T23:28:23Z")

</div>


