# Mass TTL

**URL:** https://discuss.elastic.co/t/mass-ttl/6277
**Category:** Elasticsearch
**Created:** [January 3, 2012, 11:36pm UTC](https://discuss.elastic.co/t/mass-ttl/6277 "2012-01-03T23:36:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![James\_Bathgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james_bathgate/32/1758_2.png) [@James\_Bathgate](https://discuss.elastic.co/u/James_Bathgate)
#### Post date: [January 3, 2012, 11:36pm UTC](https://discuss.elastic.co/t/mass-ttl/6277/1 "2012-01-03T23:36:14Z")

</div>

I have an issue when I bulk insert a large number (~17k) of documents with  
the same TTL. It seems to delete some (~2k) of them, but the rest seem to  
just sit there forever. It then attempts to delete these documents again  
every TTL interval and I get errors for them in the error log. Here is a  
sample of the error I'm getting.

[2012-01-03 15:29:05,225][DEBUG][action.bulk] [Nelson, Greer  
Grant] [autocomplete\_test][7] failed to bulk item (delete) delete  
{[autocomplete\_test][searchSuggestion][c550997558871ca5729691e1e3d9dd51]}  
org.elasticsearch.index.engine.VersionConflictEngineException:  
[autocomplete\_test][7]  
[searchSuggestion][c550997558871ca5729691e1e3d9dd51]: version conflict,  
current [-1], required [1]  
at  
org.elasticsearch.index.engine.robin.RobinEngine.innerDelete(RobinEngine.java:646)  
at  
org.elasticsearch.index.engine.robin.RobinEngine.delete(RobinEngine.java:597)  
at  
org.elasticsearch.index.shard.service.InternalIndexShard.delete(InternalIndexShard.java:336)  
at  
org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:178)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:487)  
at  
org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:400)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

### Author: ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)
#### Post date: [January 4, 2012, 11:30am UTC](https://discuss.elastic.co/t/mass-ttl/6277/2 "2012-01-04T11:30:12Z")

</div>

That failure is actually no longer logged in master (version conflict  
failures on DEBUG level). But, it might help us here. Are you suggeting  
that the document logged in your case is still there in the index  
(c550997558871ca5729691e1e3d9dd51)? Cause that version conflict means  
trying to delete a document that is already deleted.

On Wed, Jan 4, 2012 at 1:36 AM, James Bathgate [julesbravo@gmail.com](mailto:julesbravo@gmail.com) wrote:

> I have an issue when I bulk insert a large number (~17k) of documents with  
> the same TTL. It seems to delete some (~2k) of them, but the rest seem to  
> just sit there forever. It then attempts to delete these documents again  
> every TTL interval and I get errors for them in the error log. Here is a  
> sample of the error I'm getting.
> 
> [2012-01-03 15:29:05,225][DEBUG][action.bulk] [Nelson,  
> Greer Grant] [autocomplete\_test][7] failed to bulk item (delete) delete  
> {[autocomplete\_test][searchSuggestion][c550997558871ca5729691e1e3d9dd51]}  
> org.elasticsearch.index.engine.VersionConflictEngineException:  
> [autocomplete\_test][7]  
> [searchSuggestion][c550997558871ca5729691e1e3d9dd51]: version conflict,  
> current [-1], required [1]  
> at  
> org.elasticsearch.index.engine.robin.RobinEngine.innerDelete(RobinEngine.java:646)  
> at  
> org.elasticsearch.index.engine.robin.RobinEngine.delete(RobinEngine.java:597)  
> at  
> org.elasticsearch.index.shard.service.InternalIndexShard.delete(InternalIndexShard.java:336)  
> at  
> org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:178)  
> at  
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:487)  
> at  
> org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:400)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)  
> at  
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)  
> at java.lang.Thread.run(Thread.java:662)

---

<div class="post-metadata">

### Author: ![James\_Bathgate](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james_bathgate/32/1758_2.png) [@James\_Bathgate](https://discuss.elastic.co/u/James_Bathgate)
#### Post date: [January 4, 2012, 4:36pm UTC](https://discuss.elastic.co/t/mass-ttl/6277/3 "2012-01-04T16:36:22Z")

</div>

Shay,

The document logged is still in the index.

Here is a log entry:  
org.elasticsearch.index.engine.VersionConflictEngineException:  
[autocomplete\_test][6]  
[searchSuggestion][a3f421daecd76189d6ff5fcf0992e9b6]: version conflict,  
current [-1], required [1]  
[2012-01-04 08:33:18,987][DEBUG][action.bulk] [Nelson, Greer  
Grant] [autocomplete\_test][6] failed to bulk item (delete) delete  
{[autocomplete\_test][searchSuggestion][a3f421daecd76189d6ff5fcf0992e9b6]}

Here is a query hitting the server and it's result:  
jbathgate@crimson:~/Projects/es$ curl -XPOST  
'[http://localhost:9200/autocomplete\_test/searchSuggestion/\_search](http://localhost:9200/autocomplete_test/searchSuggestion/_search)' -d  
'{"size": 1, "query":{"match\_all":{}}}'  
{"took":2,"timed\_out":false,"\_shards":{"total":10,"successful":10,"failed":0},"hits":{"total":15656,"max\_score":1.0,"hits":[{"\_index":"autocomplete\_test","\_type":"searchSuggestion","\_id":"a3f421daecd76189d6ff5fcf0992e9b6","\_score":1.0,  
"\_source" :  
{"\_id":"a3f421daecd76189d6ff5fcf0992e9b6","siteId":"vw50sm","searchQuery":"pro  
circuit","searchQueryAutocompleteExact":"pro  
circuit","popularity":0.60427935600034}}]}}

As you can see that document definitely still exists.

---

<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 6, 2017, 3:43am UTC](https://discuss.elastic.co/t/mass-ttl/6277/4 "2017-07-06T03:43:47Z")

</div>


