---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
- requires:
    cluster_features: "gte_v8.14.0"
    reason: "_tsid hashing introduced in 8.13 and tsid routing changed in 8.14"
- do:
    indices.create:
      index: "id_generation_test"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            - "k8s.pod.uid"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            number_of_shards: 2
        mappings:
          properties:
            '@timestamp':
              type: "date"
            metricset:
              type: "keyword"
              time_series_dimension: true
            k8s:
              properties:
                pod:
                  properties:
                    uid:
                      type: "keyword"
                      time_series_dimension: true
                    name:
                      type: "keyword"
                    ip:
                      type: "ip"
                    network:
                      properties:
                        tx:
                          type: "long"
                        rx:
                          type: "long"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    bulk:
      refresh: true
      index: "id_generation_test"
      body:
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:04.467Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"cat\", \"uid\":\"947e4ced-1786-4e53-9e0c-5c447e959507\"\
        , \"ip\": \"10.10.55.1\", \"network\": {\"tx\": 2001818691, \"rx\": 802133794}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:24.467Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"cat\", \"uid\":\"947e4ced-1786-4e53-9e0c-5c447e959507\"\
        , \"ip\": \"10.10.55.1\", \"network\": {\"tx\": 2005177954, \"rx\": 801479970}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:44.467Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"cat\", \"uid\":\"947e4ced-1786-4e53-9e0c-5c447e959507\"\
        , \"ip\": \"10.10.55.1\", \"network\": {\"tx\": 2006223737, \"rx\": 802337279}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:51:04.467Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"cat\", \"uid\":\"947e4ced-1786-4e53-9e0c-5c447e959507\"\
        , \"ip\": \"10.10.55.2\", \"network\": {\"tx\": 2012916202, \"rx\": 803685721}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:03.142Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"dog\", \"uid\":\"df3145b3-0563-4d3b-a0f7-897eb2876ea9\"\
        , \"ip\": \"10.10.55.3\", \"network\": {\"tx\": 1434521831, \"rx\": 530575198}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:23.142Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"dog\", \"uid\":\"df3145b3-0563-4d3b-a0f7-897eb2876ea9\"\
        , \"ip\": \"10.10.55.3\", \"network\": {\"tx\": 1434577921, \"rx\": 530600088}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:53.142Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"dog\", \"uid\":\"df3145b3-0563-4d3b-a0f7-897eb2876ea9\"\
        , \"ip\": \"10.10.55.3\", \"network\": {\"tx\": 1434587694, \"rx\": 530604797}}}}"
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:51:03.142Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"dog\", \"uid\":\"df3145b3-0563-4d3b-a0f7-897eb2876ea9\"\
        , \"ip\": \"10.10.55.3\", \"network\": {\"tx\": 1434595272, \"rx\": 530605511}}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
generates a consistent id:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- requires:
    cluster_features: "tsdb.ts_routing_hash_doc_value_parse_byte_ref"
    reason: "_tsid routing hash doc value parsing has been fixed"
- do:
    bulk:
      refresh: true
      index: "id_generation_test"
      body:
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:52:04.467Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"cat\", \"uid\":\"947e4ced-1786-4e53-9e0c-5c447e959507\"\
        , \"ip\": \"10.10.55.1\", \"network\": {\"tx\": 2001818691, \"rx\": 802133794}}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.index._id: "cZZNs7B9sSWsyrL5AAABeRnS7fM"
- do:
    bulk:
      refresh: true
      index: "id_generation_test"
      body:
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:52:04.467Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"cat\", \"uid\":\"947e4ced-1786-4e53-9e0c-5c447e959507\"\
        , \"ip\": \"10.10.55.1\", \"network\": {\"tx\": 2001818691, \"rx\": 802133794}}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.index._id: "cZZNs7B9sSWsyrL5AAABeRnS7fM"
- do:
    get:
      index: "id_generation_test"
      id: "cn4excfoxSs_KdA5AAABeRnRFAY"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    _index: "id_generation_test"
- match:
    _id: "cn4excfoxSs_KdA5AAABeRnRFAY"
- match:
    _source:
      '@timestamp': "2021-04-28T18:50:03.142Z"
      metricset: "pod"
      k8s:
        pod:
          name: "dog"
          uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
          ip: "10.10.55.3"
          network:
            tx: 1434521831
            rx: 530575198
- do:
    search:
      index: "id_generation_test"
      body:
        query:
          match_all: {}
        sort:
        - "@timestamp"
        _source: true
        docvalue_fields:
        - "_ts_routing_hash"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    hits.total.value: 9
- match:
    hits.hits.0._id: "cn4excfoxSs_KdA5AAABeRnRFAY"
- match:
    hits.hits.0.fields._ts_routing_hash:
    - "cn4exQ"
- match:
    hits.hits.0._source.@timestamp: "2021-04-28T18:50:03.142Z"
- match:
    hits.hits.0._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.1._id: "cZZNs7B9sSWsyrL5AAABeRnRGTM"
- match:
    hits.hits.1._source.@timestamp: "2021-04-28T18:50:04.467Z"
- match:
    hits.hits.1._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.2._id: "cn4excfoxSs_KdA5AAABeRnRYiY"
- match:
    hits.hits.2._source.@timestamp: "2021-04-28T18:50:23.142Z"
- match:
    hits.hits.2._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.3._id: "cZZNs7B9sSWsyrL5AAABeRnRZ1M"
- match:
    hits.hits.3._source.@timestamp: "2021-04-28T18:50:24.467Z"
- match:
    hits.hits.3._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.4._id: "cZZNs7B9sSWsyrL5AAABeRnRtXM"
- match:
    hits.hits.4._source.@timestamp: "2021-04-28T18:50:44.467Z"
- match:
    hits.hits.4._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.5._id: "cn4excfoxSs_KdA5AAABeRnR11Y"
- match:
    hits.hits.5._source.@timestamp: "2021-04-28T18:50:53.142Z"
- match:
    hits.hits.5._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.6._id: "cn4excfoxSs_KdA5AAABeRnR_mY"
- match:
    hits.hits.6._source.@timestamp: "2021-04-28T18:51:03.142Z"
- match:
    hits.hits.6._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.7._id: "cZZNs7B9sSWsyrL5AAABeRnSA5M"
- match:
    hits.hits.7._source.@timestamp: "2021-04-28T18:51:04.467Z"
- match:
    hits.hits.7._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.8._id: "cZZNs7B9sSWsyrL5AAABeRnS7fM"
- match:
    hits.hits.8._source.@timestamp: "2021-04-28T18:52:04.467Z"
- match:
    hits.hits.8._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- do:
    search:
      index: "id_generation_test"
      body:
        query:
          match_all: {}
        sort:
        - "@timestamp"
        - "_ts_routing_hash"
        _source: true
        search_after:
        - "2021-04-28T18:50:03.142Z"
        - "cn4exQ"
        docvalue_fields:
        - "_ts_routing_hash"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    hits.total.value: 9
- match:
    hits.hits.0._id: "cZZNs7B9sSWsyrL5AAABeRnRGTM"
- match:
    hits.hits.0._source.@timestamp: "2021-04-28T18:50:04.467Z"
- match:
    hits.hits.0._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.1._id: "cn4excfoxSs_KdA5AAABeRnRYiY"
- match:
    hits.hits.1._source.@timestamp: "2021-04-28T18:50:23.142Z"
- match:
    hits.hits.1._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.2._id: "cZZNs7B9sSWsyrL5AAABeRnRZ1M"
- match:
    hits.hits.2._source.@timestamp: "2021-04-28T18:50:24.467Z"
- match:
    hits.hits.2._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.3._id: "cZZNs7B9sSWsyrL5AAABeRnRtXM"
- match:
    hits.hits.3._source.@timestamp: "2021-04-28T18:50:44.467Z"
- match:
    hits.hits.3._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.4._id: "cn4excfoxSs_KdA5AAABeRnR11Y"
- match:
    hits.hits.4._source.@timestamp: "2021-04-28T18:50:53.142Z"
- match:
    hits.hits.4._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.5._id: "cn4excfoxSs_KdA5AAABeRnR_mY"
- match:
    hits.hits.5._source.@timestamp: "2021-04-28T18:51:03.142Z"
- match:
    hits.hits.5._source.k8s.pod.uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
- match:
    hits.hits.6._id: "cZZNs7B9sSWsyrL5AAABeRnSA5M"
- match:
    hits.hits.6._source.@timestamp: "2021-04-28T18:51:04.467Z"
- match:
    hits.hits.6._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
- match:
    hits.hits.7._id: "cZZNs7B9sSWsyrL5AAABeRnS7fM"
- match:
    hits.hits.7._source.@timestamp: "2021-04-28T18:52:04.467Z"
- match:
    hits.hits.7._source.k8s.pod.uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
---
index a new document on top of an old one:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    search:
      index: "id_generation_test"
      body:
        size: 0
        aggs:
          max_tx:
            max:
              field: "k8s.pod.network.tx"
          max_rx:
            min:
              field: "k8s.pod.network.rx"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    aggregations.max_tx.value: 2.012916202E9
- match:
    aggregations.max_rx.value: 5.30575198E8
- do:
    index:
      refresh: true
      index: "id_generation_test"
      op_type: "index"
      body:
        '@timestamp': "2021-04-28T18:51:03.142Z"
        metricset: "pod"
        k8s:
          pod:
            name: "dog"
            uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
            ip: "10.10.55.3"
            network:
              tx: 111434595272
              rx: 430605511
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    _id: "cn4excfoxSs_KdA5AAABeRnR_mY"
- do:
    search:
      index: "id_generation_test"
      body:
        size: 0
        aggs:
          max_tx:
            max:
              field: "k8s.pod.network.tx"
          min_rx:
            min:
              field: "k8s.pod.network.rx"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    aggregations.max_tx.value: 1.11434595272E11
- match:
    aggregations.min_rx.value: 4.30605511E8
---
index a new document on top of an old one over bulk:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    search:
      index: "id_generation_test"
      body:
        size: 0
        aggs:
          max_tx:
            max:
              field: "k8s.pod.network.tx"
          max_rx:
            min:
              field: "k8s.pod.network.rx"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    aggregations.max_tx.value: 2.012916202E9
- match:
    aggregations.max_rx.value: 5.30575198E8
- do:
    bulk:
      refresh: true
      index: "id_generation_test"
      body:
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:51:03.142Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"dog\", \"uid\":\"df3145b3-0563-4d3b-a0f7-897eb2876ea9\"\
        , \"ip\": \"10.10.55.3\", \"network\": {\"tx\": 111434595272, \"rx\": 430605511}}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.index._id: "cn4excfoxSs_KdA5AAABeRnR_mY"
- do:
    search:
      index: "id_generation_test"
      body:
        size: 0
        aggs:
          max_tx:
            max:
              field: "k8s.pod.network.tx"
          max_rx:
            min:
              field: "k8s.pod.network.rx"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    aggregations.max_tx.value: 1.11434595272E11
- match:
    aggregations.max_rx.value: 4.30605511E8
---
create operation on top of old document fails:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    catch: "/\\[cn4excfoxSs_KdA5AAABeRnR_mY\\]\\[.*@2021-04-28T18:51:03.142Z\\]: version\
      \ conflict, document already exists \\(current version \\[1\\]\\)/"
    index:
      refresh: true
      index: "id_generation_test"
      body:
        '@timestamp': "2021-04-28T18:51:03.142Z"
        metricset: "pod"
        k8s:
          pod:
            name: "dog"
            uid: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"
            ip: "10.10.55.3"
            network:
              tx: 111434595272
              rx: 430605511
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
create operation on top of old document fails over bulk:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    bulk:
      refresh: true
      index: "id_generation_test"
      body:
      - "{\"create\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:51:03.142Z\", \"metricset\": \"pod\", \"\
        k8s\": {\"pod\": {\"name\": \"dog\", \"uid\":\"df3145b3-0563-4d3b-a0f7-897eb2876ea9\"\
        , \"ip\": \"10.10.55.3\", \"network\": {\"tx\": 111434595272, \"rx\": 430605511}}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.create.error.reason: "[cn4excfoxSs_KdA5AAABeRnR_mY][KCjEJ9R_BgO8TRX2QOd6dpQ5ihHD--qoyLTiOy0pmP6_RAIE-e0-dKQ@2021-04-28T18:51:03.142Z]:\
      \ version conflict, document already exists (current version [1])"
---
ids query:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    search:
      index: "id_generation_test"
      body:
        fields:
        - field: "k8s.pod.network.tx"
        query:
          ids:
            values:
            - "cn4excfoxSs_KdA5AAABeRnR11Y"
            - "cn4excfoxSs_KdA5AAABeRnR_mY"
        sort:
        - "@timestamp"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    hits.total.value: 2
- match:
    hits.hits.0._id: "cn4excfoxSs_KdA5AAABeRnR11Y"
- match:
    hits.hits.0.fields.k8s\.pod\.network\.tx:
    - 1434587694
- match:
    hits.hits.1._id: "cn4excfoxSs_KdA5AAABeRnR_mY"
- match:
    hits.hits.1.fields.k8s\.pod\.network\.tx:
    - 1434595272
---
get:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    get:
      index: "id_generation_test"
      id: "cZZNs7B9sSWsyrL5AAABeRnSA5M"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    _index: "id_generation_test"
- match:
    _id: "cZZNs7B9sSWsyrL5AAABeRnSA5M"
- match:
    _source:
      '@timestamp': "2021-04-28T18:51:04.467Z"
      metricset: "pod"
      k8s:
        pod:
          name: "cat"
          uid: "947e4ced-1786-4e53-9e0c-5c447e959507"
          ip: "10.10.55.2"
          network:
            tx: 2012916202
            rx: 803685721
---
get not found:
- do:
    catch: "missing"
    get:
      index: "id_generation_test"
      id: "not found"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
get with routing:
- do:
    catch: "bad_request"
    get:
      index: "id_generation_test"
      id: "cZZNs-xII2fZweptAAABeRnSA5M"
      routing: "routing"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
delete:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    delete:
      index: "id_generation_test"
      id: "cn4excfoxSs_KdA5AAABeRnR_mY"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    result: "deleted"
---
delete not found:
- do:
    catch: "missing"
    delete:
      index: "id_generation_test"
      id: "not found"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
delete with routing:
- do:
    catch: "bad_request"
    delete:
      index: "id_generation_test"
      id: "not found"
      routing: "routing"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
---
delete over _bulk:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    mget:
      index: "id_generation_test"
      body:
        ids:
        - "cn4excfoxSs_KdA5AAABeRnR_mY"
        - "cn4excfoxSs_KdA5AAABeRnR11Y"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    docs.0._index: "id_generation_test"
- match:
    docs.0._id: "cn4excfoxSs_KdA5AAABeRnR_mY"
- match:
    docs.0.found: true
- match:
    docs.1._index: "id_generation_test"
- match:
    docs.1._id: "cn4excfoxSs_KdA5AAABeRnR11Y"
- match:
    docs.1.found: true
- do:
    bulk:
      index: "id_generation_test"
      body:
      - "{\"delete\": {\"_id\": \"cn4excfoxSs_KdA5AAABeRnR_mY\"}}"
      - "{\"delete\": {\"_id\": \"cn4excfoxSs_KdA5AAABeRnR11Y\"}}"
      - "{\"delete\": {\"_id\": \"not found ++ not found\"}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.delete.result: "deleted"
- match:
    items.1.delete.result: "deleted"
- match:
    items.2.delete.status: 404
- match:
    items.2.delete.error.reason: "/invalid\\ id\\ \\[not\\ found\\ \\+\\+\\ not\\\
      \ found\\]\\ for\\ index\\ \\[id_generation_test\\]\\ in\\ time.series\\ mode/"
---
routing_path matches deep object:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    indices.create:
      index: "routing_path_test"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "dim.**.uid"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            number_of_replicas: 0
            number_of_shards: 2
        mappings:
          properties:
            '@timestamp':
              type: "date"
            dim:
              properties:
                foo:
                  properties:
                    bar:
                      properties:
                        baz:
                          properties:
                            uid:
                              type: "keyword"
                              time_series_dimension: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    bulk:
      refresh: true
      index: "routing_path_test"
      body:
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:04.467Z\", \"dim\": {\"foo\": {\"bar\"\
        : {\"baz\": {\"uid\": \"uid1\"}}}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.index.result: "created"
- match:
    items.0.index._id: "OcEOGchJrjH1fFX8AAABeRnRGTM"
---
routing_path matches object:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- do:
    indices.create:
      index: "routing_path_test_2"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "dim.*.uid"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            number_of_replicas: 0
            number_of_shards: 2
        mappings:
          properties:
            '@timestamp':
              type: "date"
            dim:
              properties:
                foo:
                  properties:
                    uid:
                      type: "keyword"
                      time_series_dimension: true
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    bulk:
      refresh: true
      index: "routing_path_test_2"
      body:
      - "{\"index\": {}}"
      - "{\"@timestamp\": \"2021-04-28T18:50:04.467Z\", \"dim\": {\"foo\": {\"uid\"\
        : \"uid1\"}}}"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    items.0.index.result: "created"
- match:
    items.0.index._id: "8bgiqW9JKwAyp1bZAAABeRnRGTM"
