# Index Inconsistency

**URL:** <https://discuss.elastic.co/t/index-inconsistency/19146>\
**Category:** Elasticsearch\
**Created:** [August 7, 2014, 5:59pm UTC](https://discuss.elastic.co/t/index-inconsistency/19146 "2014-08-07T17:59:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Drew\_Daugherty\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drew_daugherty_2/32/1289_2.png) [@Drew\_Daugherty\_2](https://discuss.elastic.co/u/Drew_Daugherty_2)\
**Post date:** [August 7, 2014, 5:59pm UTC](https://discuss.elastic.co/t/index-inconsistency/19146/1 "2014-08-07T17:59:47Z")

</div>

We are seeing inconsistent results for a get on one of our documents. When  
I tried a get using the doc id, sometimes the document would come back and  
sometimes it would not. We are using routing for this index but this  
happens even when specifying the right routing key. To try and fix the  
problem, I reindexed the doc to try and fix the problem but I am still  
seeing inconsistent results. A document is now consistently returned but  
when the original doc is returned, it has version set to 2. When the new  
doc that was indexed is returned, version is set to 1.

[dd@search ~]$ curl -XGET  
'[http://localhost:9200/blah\_201403/segment/foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com](http://localhost:9200/blah_201403/segment/foo.com_20140303_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com)'  
{"\_index":"blah\_201403","\_type":"segment","\_id":"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32","\_version":2,"exists":true,  
"\_source" : { "roll\_key" :  
"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32", "dom" : "[foo.com](http://foo.com)",  
"received\_date" : "20140303"}}

[dd@search ~]$ curl -XGET  
'[http://localhost:9200/blah\_201403/segment/foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com](http://localhost:9200/blah_201403/segment/foo.com_20140303_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com)'  
{"\_index":"blah\_201403","\_type":"segment","\_id":"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32","\_version":1,"exists":true,  
"\_source" :  
{ "roll\_key" : "foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32",  
"domain" : "[foo.com](http://foo.com)", "received\_date" : "20140303"}}

We are using elasticsearch 0.90.7.

-drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 7, 2014, 9:33pm UTC](https://discuss.elastic.co/t/index-inconsistency/19146/2 "2014-08-07T21:33:48Z")

</div>

Do you index with replica level \> 0?  
How many nodes?  
Do you execute GET against same node or against different nodes?  
Does searching the doc \_id work?  
Is it only this document, and others are ok?  
Are are messages in a server logfile?  
Does preference "primary" make a difference?

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

And, can you upgrade ES?

Jörg

On Thu, Aug 7, 2014 at 7:59 PM, Drew Daugherty \<  
[drew.daugherty@returnpath.com](mailto:drew.daugherty@returnpath.com)\> wrote:

> We are seeing inconsistent results for a get on one of our documents.  
> When I tried a get using the doc id, sometimes the document would come  
> back and sometimes it would not. We are using routing for this index but  
> this happens even when specifying the right routing key. To try and fix  
> the problem, I reindexed the doc to try and fix the problem but I am still  
> seeing inconsistent results. A document is now consistently returned but  
> when the original doc is returned, it has version set to 2. When the new  
> doc that was indexed is returned, version is set to 1.
> 
> [dd@search ~]$ curl -XGET '  
> [http://localhost:9200/blah\_201403/segment/foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com](http://localhost:9200/blah_201403/segment/foo.com_20140303_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com)  
> '  
> {"\_index":"blah\_201403","\_type":"segment","\_id":"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32","\_version":2,"exists":true,  
> "\_source" : { "roll\_key" :  
> "foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32", "dom" : "[foo.com](http://foo.com)",  
> "received\_date" : "20140303"}}
> 
> [dd@search ~]$ curl -XGET '  
> [http://localhost:9200/blah\_201403/segment/foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com](http://localhost:9200/blah_201403/segment/foo.com_20140303_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com)  
> '  
> {"\_index":"blah\_201403","\_type":"segment","\_id":"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32","\_version":1,"exists":true,  
> "\_source" :  
> { "roll\_key" : "foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32",  
> "domain" : "[foo.com](http://foo.com)", "received\_date" : "20140303"}}
> 
> We are using elasticsearch 0.90.7.
> 
> -drew
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEvjQ5Kwmg6kFX10FyCwh-D%3Doc%3DSvR5C%3DnDPc3uANo4uQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEvjQ5Kwmg6kFX10FyCwh-D%3Doc%3DSvR5C%3DnDPc3uANo4uQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Drew\_Daugherty\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drew_daugherty_2/32/1289_2.png) [@Drew\_Daugherty\_2](https://discuss.elastic.co/u/Drew_Daugherty_2)\
**Post date:** [August 8, 2014, 2:46pm UTC](https://discuss.elastic.co/t/index-inconsistency/19146/3 "2014-08-08T14:46:10Z")

</div>

Index is set to one replica. 4 data nodes, 3 masters, 1 client node.  
Executing the get against a client node on the cluster but masters yield  
the same result. Data nodes have http turned off currently. Other docs  
seem to work fine but we suspect the problem is more widespread. Is there  
a way to search by document version numbers? Searching without routing  
returns _both_ docs, with routing only returns 1 (but I can't tell which  
one, guessing the version 1 doc). Using preference \_primary always causes  
the version 1 doc to be retrieved. There do not seem to be any useful  
messages in the cluster logfiles. We are planning on upgrading to 1.2 soon.  
Is there a possibility this problem will be fixed if we upgrade?

-drew

On Thursday, August 7, 2014 3:33:56 PM UTC-6, Jörg Prante wrote:

> Do you index with replica level \> 0?  
> How many nodes?  
> Do you execute GET against same node or against different nodes?  
> Does searching the doc \_id work?  
> Is it only this document, and others are ok?  
> Are are messages in a server logfile?  
> Does preference "primary" make a difference?
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-preference.html)
> 
> And, can you upgrade ES?
> 
> Jörg
> 
> On Thu, Aug 7, 2014 at 7:59 PM, Drew Daugherty \<[drew.da...@returnpath.com](mailto:drew.da...@returnpath.com)  
> \<javascript:\>\> wrote:
> 
> > We are seeing inconsistent results for a get on one of our documents.  
> > When I tried a get using the doc id, sometimes the document would come  
> > back and sometimes it would not. We are using routing for this index but  
> > this happens even when specifying the right routing key. To try and fix  
> > the problem, I reindexed the doc to try and fix the problem but I am still  
> > seeing inconsistent results. A document is now consistently returned but  
> > when the original doc is returned, it has version set to 2. When the new  
> > doc that was indexed is returned, version is set to 1.
> > 
> > [dd@search ~]$ curl -XGET '  
> > [http://localhost:9200/blah\_201403/segment/foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com](http://localhost:9200/blah_201403/segment/foo.com_20140303_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com)  
> > '  
> > {"\_index":"blah\_201403","\_type":"segment","\_id":"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32","\_version":2,"exists":true,  
> > "\_source" : { "roll\_key" :  
> > "foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32", "dom" : "[foo.com](http://foo.com)",  
> > "received\_date" : "20140303"}}
> > 
> > [dd@search ~]$ curl -XGET '  
> > [http://localhost:9200/blah\_201403/segment/foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com](http://localhost:9200/blah_201403/segment/foo.com_20140303_fbd28d761e38fe82465c94c1cc23fa32?routing=foo.com)  
> > '  
> > {"\_index":"blah\_201403","\_type":"segment","\_id":"foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32","\_version":1,"exists":true,  
> > "\_source" :  
> > { "roll\_key" : "foo.com\_20140303\_fbd28d761e38fe82465c94c1cc23fa32",  
> > "domain" : "[foo.com](http://foo.com)", "received\_date" : "20140303"}}
> > 
> > We are using elasticsearch 0.90.7.
> > 
> > -drew
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/2fa15b98-f9a7-480f-a33d-29b5bb35819d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/023a1810-9c30-4639-abc3-d79286f0972d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/023a1810-9c30-4639-abc3-d79286f0972d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [August 8, 2014, 8:48pm UTC](https://discuss.elastic.co/t/index-inconsistency/19146/4 "2014-08-08T20:48:13Z")

</div>

If you see both docs, you probably encountered the hashing bug of 1.2.0

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

but if you are on 1.1 I have doubts. Strange.

I recommend to upgrade to 1.3.x und reindex all relevant docs...

Jörg

On Fri, Aug 8, 2014 at 4:46 PM, Drew Daugherty \<  
[drew.daugherty@returnpath.com](mailto:drew.daugherty@returnpath.com)\> wrote:

> Searching without routing returns _both_ docs, with routing only returns  
> 1 (but I can't tell which one, guessing the version 1 doc). Using  
> preference \_primary always causes the version 1 doc to be retrieved. There  
> do not seem to be any useful messages in the cluster logfiles. We are  
> planning on upgrading to 1.2 soon. Is there a possibility this problem will  
> be fixed if we upgrade?
> 
> -drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHLNJn8FKLwuL1o3iBJr0rxqtGbr9yx8t-S%3DvDp72-Qiw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHLNJn8FKLwuL1o3iBJr0rxqtGbr9yx8t-S%3DvDp72-Qiw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Drew\_Daugherty\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drew_daugherty_2/32/1289_2.png) [@Drew\_Daugherty\_2](https://discuss.elastic.co/u/Drew_Daugherty_2)\
**Post date:** [August 8, 2014, 10:59pm UTC](https://discuss.elastic.co/t/index-inconsistency/19146/5 "2014-08-08T22:59:10Z")

</div>

We are using elasticsearch 0.90.7.

-drew

On Friday, August 8, 2014 2:48:21 PM UTC-6, Jörg Prante wrote:

> If you see both docs, you probably encountered the hashing bug of 1.2.0
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/blog/elasticsearch-1-2-1-released/)
> 
> but if you are on 1.1 I have doubts. Strange.
> 
> I recommend to upgrade to 1.3.x und reindex all relevant docs...
> 
> Jörg
> 
> On Fri, Aug 8, 2014 at 4:46 PM, Drew Daugherty \<[drew.da...@returnpath.com](mailto:drew.da...@returnpath.com)  
> \<javascript:\>\> wrote:
> 
> > Searching without routing returns _both_ docs, with routing only returns  
> > 1 (but I can't tell which one, guessing the version 1 doc). Using  
> > preference \_primary always causes the version 1 doc to be retrieved. There  
> > do not seem to be any useful messages in the cluster logfiles. We are  
> > planning on upgrading to 1.2 soon. Is there a possibility this problem will  
> > be fixed if we upgrade?
> > 
> > -drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d019326a-fc12-4c23-9b21-d34d41442ad5%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d019326a-fc12-4c23-9b21-d34d41442ad5%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![AsyncAwait](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asyncawait/32/1346_2.png) [@AsyncAwait](https://discuss.elastic.co/u/AsyncAwait)\
**Post date:** [August 9, 2014, 5:25am UTC](https://discuss.elastic.co/t/index-inconsistency/19146/6 "2014-08-09T05:25:17Z")

</div>

I think you should upgrade anything above 1.1

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/6c719ce8-23fd-4a44-bb9c-4d620299c932%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/6c719ce8-23fd-4a44-bb9c-4d620299c932%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:09am UTC](https://discuss.elastic.co/t/index-inconsistency/19146/7 "2017-07-06T01:09:52Z")

</div>


