Skip to content

Range datatypes reindex failed when upgrading from 5.6 to 6.2 using remote reindex api #29313

@ydalbj

Description

@ydalbj

report error: "[expected_attendees] is defined as an object in mapping [mytype] but this name is already used for a field in other types"

Here is what I did.

  1. Ceate index and add 1 doc on old host with Elasticsearch 5.6, just as the doc example.
PUT range_index_old
{
  "mappings": {
    "mytype": {
      "properties": {
        "expected_attendees": {
          "type": "integer_range"
        },
        "time_frame": {
          "type": "date_range", 
          "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
        }
      }
    }
  }
}

PUT range_index_old/mytype/1
{
  "expected_attendees" : { 
    "gte" : 10,
    "lte" : 20
  },
  "time_frame" : { 
    "gte" : "2015-10-31 12:00:00", 
    "lte" : "2015-11-01"
  }
}
  1. Create a index with the same mapping on new host with Elasticsearch 6.2
PUT range_index_new
{
  "mappings": {
    "_doc": {
      "properties": {
        "expected_attendees": {
          "type": "integer_range"
        },
        "time_frame": {
          "type": "date_range", 
          "format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
        }
      }
    }
  }
}

  1. then reindex from old host to new host following the docs( https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-remote.html#reindex-upgrade-remote )
POST _reindex
{
  "source": {
    "remote": {
      "host": "http://oldhost:9200",
      "username": "user",
      "password": "pass"
    },
    "index": "range_index_old"
  },
  "dest": {
    "index": "range_index_new"
  }
}

  1. I'm getting this error response
{
  "took": 14,
  "timed_out": false,
  "total": 1,
  "updated": 0,
  "created": 0,
  "deleted": 0,
  "batches": 1,
  "version_conflicts": 0,
  "noops": 0,
  "retries": {
    "bulk": 0,
    "search": 0
  },
  "throttled_millis": 0,
  "requests_per_second": -1,
  "throttled_until_millis": 0,
  "failures": [
    {
      "index": "range_index_new",
      "type": "mytype",
      "id": "1",
      "cause": {
        "type": "illegal_argument_exception",
        "reason": "[expected_attendees] is defined as an object in mapping [mytype] but this name is already used for a field in other types"
      },
      "status": 400
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions