elastic / elasticsearch-migration

This plugin will help you to check whether you can upgrade directly to the next major version of Elasticsearch, or whether you need to make changes to your data and cluster before doing so.
290 stars 32 forks source link

Segments checks don't work on marvel Indices #3

Closed colings86 closed 9 years ago

colings86 commented 9 years ago

the migration plugin fails on marvel indices (e.g. '.marvel-2014.11.25') with the following error on the ancient segments check:

Ancient index segments
    This index is closed and cannot be checked for ancient segments.

Even thought the index is open. The reason for this is that a call to GET .marvel-2014.11.25/_segments does not return any segments information:

{
   "_shards": {
      "total": 2,
      "successful": 0,
      "failed": 0
   },
   "indices": {}
}

Whereas a call to GET .marvel-*/_segments returns segment information:

{
   "_shards": {
      "total": 30,
      "successful": 11,
      "failed": 0
   },
   "indices": {
      ".marvel-2015.03.03": {
         "shards": {
            "0": [
               {
                  "routing": {
                     "state": "STARTED",
                     "primary": true,
                     "node": "e-NhKBo6S8KTlSsoYW9l-Q"
                  },
                  "num_committed_segments": 8,
                  "num_search_segments": 8,
                  "segments": {
                     "_11j": {
                        "generation": 1351,
                        "num_docs": 18881,
                        "deleted_docs": 0,
                        "size_in_bytes": 17557614,
                        "memory_in_bytes": 619986,
                        "committed": true,
                        "search": true,
                        "version": "4.10.2",
                        "compound": false
                     },
                     "_1ns": {
                        "generation": 2152,
                        "num_docs": 10785,
                        "deleted_docs": 0,
                        "size_in_bytes": 10202253,
                        "memory_in_bytes": 544986,
                        "committed": true,
                        "search": true,
                        "version": "4.10.2",
                        "compound": false
                     },
...
}

This happens even with @skearns64 fix in PR #2. This looks like its a bug in Elasticsearch but we will presumably also need a workaround here as this plugin is to be used on old clusters

colings86 commented 9 years ago

The cause of the issue is not the GET _segments API but the error does appear for all marvel indices

clintongormley commented 9 years ago

Fixed by 4bd5f517b73e6ee6efa47189c40cddccef7bb773