# Docs missing from a replica

**URL:** <https://discuss.elastic.co/t/docs-missing-from-a-replica/57382>\
**Category:** Elasticsearch\
**Created:** [August 5, 2016, 6:04pm UTC](https://discuss.elastic.co/t/docs-missing-from-a-replica/57382 "2016-08-05T18:04:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Hart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_hart/32/65937_2.png) [@Michael\_Hart](https://discuss.elastic.co/u/Michael_Hart)\
**Post date:** [August 5, 2016, 6:04pm UTC](https://discuss.elastic.co/t/docs-missing-from-a-replica/57382/1 "2016-08-05T18:04:13Z")

</div>

I am missing documents from some shard replicas, looking for advice on how to debug this further. The initial symptom is that an update on a document id failed, further investigation showed that some nodes could search for the id and some failed. For example (all identifiers changed to protect the innocent):

`GET /myindex/_search?q=doc1234`

returns this when the query hits the shard where the doc doesn't exist:

```
"hits" : {
"total" : 1,
"max_score" : 1.0,
"hits" : [ {
  "_index" : "myindex",
  "_type" : "mydoctype",
  "_id" : "doc1234"
  "_score" : 1.0,
  "_source" : {
    "explain" : true
  }
} ]

```

When I add the 'explain' parameter I can figure out which shard instance it is, and turns out that the primary has 3 fewer documents than the replica.

After further investigation I see that the document count between primary and replicas are different in 469 of my 8662 shards. I suspect there's more but short of comparing doc id's between the primary/replica of each shard (not really possible given the size) that's all I can go by for now.

Running Elasticsearch v2.3.3. Some indices were brought over from v1.7 but many were created in v2.3.3 recently.

This smells similar to the discussion on this thread: [How to fix primary-replica inconsistency?](https://discuss.elastic.co/t/how-to-fix-primary-replica-inconsistency/9016)

Any suggestions/ideas?

---

<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:** [August 6, 2016, 5:26am UTC](https://discuss.elastic.co/t/docs-missing-from-a-replica/57382/2 "2016-08-06T05:26:47Z")

</div>

Are these shards from 1.X?

---

<div class="post-metadata">

**Author:** ![Michael\_Hart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_hart/32/65937_2.png) [@Michael\_Hart](https://discuss.elastic.co/u/Michael_Hart)\
**Post date:** [August 6, 2016, 11:34am UTC](https://discuss.elastic.co/t/docs-missing-from-a-replica/57382/3 "2016-08-06T11:34:33Z")

</div>

Some are from v1.x, some are new indexes created in v2.3.3 yesterday.

---

<div class="post-metadata">

**Author:** ![Michael\_Hart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_hart/32/65937_2.png) [@Michael\_Hart](https://discuss.elastic.co/u/Michael_Hart)\
**Post date:** [August 8, 2016, 4:00pm UTC](https://discuss.elastic.co/t/docs-missing-from-a-replica/57382/4 "2016-08-08T16:00:51Z")

</div>

I also opened issue [https://github.com/elastic/elasticsearch/issues/19866](https://github.com/elastic/elasticsearch/issues/19866)

---

<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, 10:29pm UTC](https://discuss.elastic.co/t/docs-missing-from-a-replica/57382/5 "2017-07-05T22:29:21Z")

</div>


