# Issue in Syncing the data between nodes

**URL:** <https://discuss.elastic.co/t/issue-in-syncing-the-data-between-nodes/214059>\
**Category:** Elasticsearch\
**Created:** [January 7, 2020, 1:18pm UTC](https://discuss.elastic.co/t/issue-in-syncing-the-data-between-nodes/214059 "2020-01-07T13:18:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baijugoradia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/baijugoradia/32/76272_2.png) [@baijugoradia](https://discuss.elastic.co/u/baijugoradia)\
**Post date:** [January 7, 2020, 1:18pm UTC](https://discuss.elastic.co/t/issue-in-syncing-the-data-between-nodes/214059/1 "2020-01-07T13:18:16Z")

</div>

We have 2 nodes node\_a and node\_b they both are on different servers where node\_a is the main node here all the data needs to be where as node\_b is a temp node where the data is being dump which needs to be synced to node\_a  
currently we are using reindex method to sync the nodes, but any doing this we have seen there is data loss in the node\_a  
For e.g.  
Node\_a has the following document

```
{
  "_index": "node_a",
  "_type": "fields",
  "_id": "AW9_qd-qSvQmY6fL_xPQ",
  "_score": 1,
  "_source": {
    "name": "BOB",
    "age": 25,
    "Location": "US",
    "other": "123"
  }
}

```

And node\_b has

```
{
    "_index": "node_b",
    "_type": "fields",
    "_id": "AW9_qd-qSvQmY6fL_xPQ",
    "_score": 1,
    "_source": {
      "name": "BOB",
      "gender": "male",
    }
  }

```

After reindexing the expected output we desire is

```
{
    "_index": "node_a",
    "_type": "fields",
    "_id": "AW9_qd-qSvQmY6fL_xPQ",
    "_score": 1,
    "_source": {
      "name": "BOB",
      "age": 25,
      "Location": "US",
      "other": "123",
 "gender": "male",
    }
  }

```

Where only the missing data gets updates in the above case it's the gender, but instead the whole document is getting replaced.

Is there a way where I can achieve this by re-indexing method where only the missing data is updated int the document.

---

<div class="post-metadata">

**Author:** ![tamara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tamara/32/47095_2.png) [@tamara](https://discuss.elastic.co/u/tamara)\
**Post date:** [January 28, 2020, 12:19pm UTC](https://discuss.elastic.co/t/issue-in-syncing-the-data-between-nodes/214059/2 "2020-01-28T12:19:28Z")

</div>

It is not possible with the reindex api, you can only know with the reindex api if there is a conflict between the docs (different versions), in order to return the conflicts you need to use "version\_type": "external" property when you reindex, otherwise the version is not considered. [https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-api-request](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html#docs-reindex-api-request)

There is a github issue that discuss the "Allow reindex to do update/upsert operations" in here: [https://github.com/elastic/elasticsearch/issues/17997](https://github.com/elastic/elasticsearch/issues/17997)

---

<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:** [February 25, 2020, 12:19pm UTC](https://discuss.elastic.co/t/issue-in-syncing-the-data-between-nodes/214059/3 "2020-02-25T12:19:31Z")

</div>

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