[es_archives] add 'auto_expand_replicas: 0-1' in index mappings (#162499)

Currently, if you try loading archive with index mappings not having
replica set into stateless ES, it won't work properly: you will get 503
error on calling `GET <index_name>/_stats`:
```
{
  "error": {
    "root_cause": [
      {
        "type": "no_shard_available_action_exception",
        "reason": null
      }
    ],
    "type": "search_phase_execution_exception",
    "reason": "all shards failed",
    "phase": "query",
    "grouped": true,
    "failed_shards": [
      {
        "shard": 0,
        "index": "indices-stats",
        "node": null,
        "reason": {
          "type": "no_shard_available_action_exception",
          "reason": null
        }
      }
    ]
  },
  "status": 503
}
```
In stateless replica is
[required](https://elastic.slack.com/archives/C037J0RKRAN/p1690218904855299)
in order to perform search requests (the "search shard").

This PR updates index mappings in es_archives with
`"auto_expand_replicas": "0-1"`, in order to be compatible with
stateless ES and so that we can re-use existing data sets rather than
creating new ones.

I checked with Core Team that we should fine to just adapt all mapping
files, but let me know if that doesn't work for you.
The same value is used to create the "real" SO
[indices](c79c09c3d0/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/actions/constants.ts (L21))
in Kibana.
This commit is contained in:
Dzmitry Lemechko 2023-07-26 15:30:54 +02:00 committed by GitHub
parent 2221ff8b55
commit f6a90974e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 135 additions and 36 deletions

View file

@ -18,6 +18,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -35,7 +36,7 @@
"type": "keyword",
"script" : { "source" : "emit('abc')" }
}
},
},
"properties": {
"filter_field": {
"type": "constant_keyword",
@ -51,9 +52,10 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -597,9 +597,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -12,6 +12,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -21,9 +21,10 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -4,6 +4,7 @@
"index": "without-timefield",
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -24,6 +25,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -44,6 +46,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -91,9 +91,10 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -367,6 +367,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -743,6 +744,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -1119,9 +1121,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -396,9 +396,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -356,6 +356,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -721,9 +722,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -4,6 +4,7 @@
"index": "newline-test",
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -136,6 +136,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mode": "time_series",
"number_of_replicas": "0",
"number_of_shards": "2",
@ -152,4 +153,4 @@
}
}
}
}
}

View file

@ -5011,6 +5011,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -20350,6 +20351,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -20369,4 +20371,4 @@
}
}
}
}
}

View file

@ -3861,6 +3861,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -7844,6 +7845,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",

View file

@ -3784,6 +3784,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -8180,6 +8181,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -12415,6 +12417,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -16648,6 +16651,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -20893,6 +20897,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -25232,6 +25237,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -25695,4 +25701,4 @@
}
}
}
}
}

View file

@ -2086,6 +2086,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -17595,6 +17596,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"

View file

@ -4071,6 +4071,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -4089,4 +4090,4 @@
}
}
}
}
}

View file

@ -3768,6 +3768,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -4226,4 +4227,4 @@
}
}
}
}
}

View file

@ -3861,6 +3861,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -7844,6 +7845,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"lifecycle": {
"name": "apm-rollover-30-days",
@ -7862,4 +7864,4 @@
}
}
}
}
}

View file

@ -4,6 +4,7 @@
"index": "auditbeat-7.0.0-alpha1-2018.11.27",
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -1900,4 +1901,4 @@
},
"aliases": {}
}
}
}

View file

@ -4,6 +4,7 @@
"index": "auditbeat-7.0.0-alpha1-2018.11.27",
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -1900,4 +1901,4 @@
},
"aliases": {}
}
}
}

View file

@ -4,6 +4,7 @@
"index": "auditbeat-users",
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {

View file

@ -16,9 +16,10 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -2684,6 +2684,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"lifecycle": {
"name": "endgame_policy-4.21.0",
"rollover_alias": "endgame-4.21.0"

View file

@ -5418,6 +5418,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"lifecycle": {
"name": "filebeat-7.0.0",
"rollover_alias": "filebeat-7.0.0"
@ -5937,4 +5938,4 @@
}
}
}
}
}

View file

@ -5418,6 +5418,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"lifecycle": {
"name": "filebeat-7.0.0",
"rollover_alias": "filebeat-7.0.0"
@ -5937,4 +5938,4 @@
}
}
}
}
}

View file

@ -225,6 +225,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"lifecycle": {
"name": "filebeat-8.0.0",
"rollover_alias": "filebeat-filebeat-8.0.0"

View file

@ -396,9 +396,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -5514,6 +5514,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -17670,6 +17671,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -18146,4 +18148,4 @@
}
}
}
}
}

View file

@ -317,6 +317,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -317,6 +317,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -5011,6 +5011,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -20350,6 +20351,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -20369,4 +20371,4 @@
}
}
}
}
}

View file

@ -1486,6 +1486,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -17002,6 +17003,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -17021,4 +17023,4 @@
}
}
}
}
}

View file

@ -2095,6 +2095,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -17605,6 +17606,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -17624,4 +17626,4 @@
}
}
}
}
}

View file

@ -265,6 +265,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"mapping": {
"total_fields": {
"limit": "10000"
@ -275,4 +276,4 @@
}
}
}
}
}

View file

@ -8475,6 +8475,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -10470,6 +10471,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -10745,4 +10747,4 @@
}
}
}
}
}

View file

@ -1704,9 +1704,10 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -8476,6 +8476,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -10472,6 +10473,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -10747,4 +10749,4 @@
}
}
}
}
}

View file

@ -21716,9 +21716,10 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -366,6 +366,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -741,9 +742,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -14,6 +14,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_shards": "1",
"number_of_replicas": "0"
}
@ -144,6 +145,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_shards": "1",
"number_of_replicas": "0"
}

View file

@ -365,6 +365,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -736,6 +737,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -1107,6 +1109,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -17,6 +17,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"max_result_window": "10001",
@ -45,6 +46,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"max_result_window": "10001",
@ -67,6 +69,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -87,6 +90,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -107,6 +111,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -133,6 +138,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -156,6 +162,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -33,6 +33,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -33,6 +33,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -203,6 +203,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -17,6 +17,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -432,10 +432,11 @@
"limit": "5000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
}
}
}
}
}

View file

@ -682,6 +682,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -1374,6 +1375,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -2007,6 +2009,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -2640,6 +2643,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -3321,6 +3325,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -4002,6 +4007,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -4866,6 +4872,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -5730,6 +5737,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -6250,6 +6258,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -6770,6 +6779,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -7258,6 +7268,7 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
@ -7746,10 +7757,11 @@
"limit": "10000"
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1",
"refresh_interval": "-1"
}
}
}
}
}

View file

@ -1943,6 +1943,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"codec": "best_compression",
"mapping": {
"total_fields": {
@ -2276,4 +2277,4 @@
}
}
}
}
}

View file

@ -21,6 +21,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -203,6 +203,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -23,6 +23,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -1410,9 +1410,10 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
}

View file

@ -364,6 +364,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -737,6 +738,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}
@ -1110,6 +1112,7 @@
}
}
},
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}

View file

@ -927,6 +927,7 @@
},
"settings": {
"index": {
"auto_expand_replicas": "0-1",
"number_of_replicas": "0",
"number_of_shards": "1"
}