Skip to content

Commit

Permalink
Update archives to 8.17.0 binary data format, unskip test (elastic#19…
Browse files Browse the repository at this point in the history
…6641)

## Summary

Addresses elastic#167676
Addresses elastic#158318
Addresses elastic#163254
Addresses elastic#163255

#### Fix for `multiple_es_nodes.test.ts`
Inspired on elastic#193899

1. Start both nodes of ES 8.17.0 with the affected data-archive on
separate terminals:
1. Node 01: `yarn es snapshot --version=8.17.0 --data-archive
src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip
--base-path .es/node01`
2. Node 02: `yarn es snapshot --version=8.17.0 --data-archive
src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip
--base-path .es/node02`

2. After ES is ready (without starting Kibana), reindex the index
`.kibana_7.13.0_002`
1. Retrieve the settings from the original index via `curl -L
'http://localhost:9200/.kibana_7.13.0_002' -H 'Content-Type:
application/json' -H 'kbn-xsrf: test' -H 'Authorization: Basic
c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d ''`
	2. Create the target index with those settings: 
	```shell
curl -L -X PUT 'http://localhost:9200/.kibana_7.13.0_003' -H
'Content-Type: application/json' -H 'kbn-xsrf: test' -H 'Authorization:
Basic c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d '{
      "mappings": {
        "properties": {
          "bar": {
            "properties": {
              "status": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "coreMigrationVersion": {
            "type": "keyword"
          },
          "foo": {
            "properties": {
              "status": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "migrationVersion": {
            "dynamic": "true",
            "properties": {
              "bar": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              },
              "foo": {
                "type": "text",
                "fields": {
                  "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                  }
                }
              }
            }
          },
          "namespace": {
            "type": "keyword"
          },
          "namespaces": {
            "type": "keyword"
          },
          "originId": {
            "type": "keyword"
          },
          "references": {
            "type": "nested",
            "properties": {
              "id": {
                "type": "keyword"
              },
              "name": {
                "type": "keyword"
              },
              "type": {
                "type": "keyword"
              }
            }
          },
          "type": {
            "type": "keyword"
          },
          "updated_at": {
            "type": "date"
          }
        }
      },
      "settings": {
        "index": {
            "hidden": "true",
            "number_of_shards": "1",
            "number_of_replicas": "0"
        }
      }
    }'
         ```
3. Reindex the content: `curl -L 'http://localhost:9200/_reindex' -H
'Content-Type: application/json' -H 'kbn-xsrf: test' -H 'Authorization:
Basic c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d '{ "source": {
"index": ".kibana_7.13.0_002" }, "dest": { "index": ".kibana_7.13.0_003"
} }'`
    4. Remove the old index and recreate the aliases
    ```shell
curl -L 'http://localhost:9200/_aliases' -H 'Content-Type:
application/json' -H 'kbn-xsrf: test' -H 'Authorization: Basic
c3lzdGVtX2luZGljZXNfc3VwZXJ1c2VyOmNoYW5nZW1l' -d '{
  "actions": [
{ "add": { "index": ".kibana_7.13.0_003", "alias": ".kibana_7.13.0_001"
} },
    { "remove_index": {"index": ".kibana_7.13.0_002" } },
{ "add": { "index": ".kibana_7.13.0_003", "alias": ".kibana_7.13.0" } },
    { "add": { "index": ".kibana_7.13.0_003", "alias": ".kibana" } }
  ]
}'
	```
3. Stop both ES nodes.
4. Compress both archives
	```shell
	cd .es/node01/8.17.0
rm -rf data/nodes # we need to remove this dir or it fails to start
again
zip -r
../../../src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip
data -x "*/\.*"
	cd ../../../
	cd .es/node02/8.17.0
rm -rf data/nodes # we need to remove this dir or it fails to start
again
zip -r
../../../src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip
data -x "*/\.*"
	cd ../../../
	```
5. Run the tests to confirm that the issue is fixed: `yarn
test:jest_integration
src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts`

#### Fix for `incompatible_cluster_routing_allocation.test.ts`
Inspired on elastic#193741

```shell
# 1. Start ES 8.17.0 with the affected data-archive
yarn es snapshot --version=8.17.0 --data-archive src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip
# ... after ES has completely started up, stop it.

# 2. Compress the archive
cd .es/8.17.0
zip -r ../../src/core/server/integration_tests/saved_objects/migrations/archives/8.0.0_v1_migrations_sample_data_saved_objects.zip data  -x "*/\.*"
cd ../../

# 3. Run the tests to confirm that the issue is fixed.
yarn test:jest_integration src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts
```

#### Fix for `read_batch_size.test.ts`
Inspired on elastic#193899

```shell
# 1. Start ES 8.17.0 with the affected data-archive
yarn es snapshot --version=8.17.0 --data-archive src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip
# ... after ES has completely started up, stop it.

# 2. Compress the archive
cd .es/8.17.0
zip -r ../../src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip data  -x "*/\.*"
cd ../../

# 3. Run the tests to confirm that the issue is fixed.
yarn test:jest_integration src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts
```
  • Loading branch information
gsoldevila authored Oct 17, 2024
1 parent 0ead257 commit 3d254c2
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 7 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ async function updateRoutingAllocations(
});
}

// FLAKY: https://github.com/elastic/kibana/issues/158318
describe.skip('incompatible_cluster_routing_allocation', () => {
describe('incompatible_cluster_routing_allocation', () => {
let client: ElasticsearchClient;
let root: Root;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ function createRoot({ logFileName, hosts }: RootConfig) {
});
}

// FLAKY: https://github.com/elastic/kibana/issues/167676
describe.skip('migration v2', () => {
describe('migration v2', () => {
let esServer: TestElasticsearchUtils;
let root: Root;
const migratedIndexAlias = `.kibana_${pkg.version}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import { delay } from '../test_utils';

const logFilePath = join(__dirname, 'read_batch_size.log');

// FLAKY: https://github.com/elastic/kibana/issues/163254
// FLAKY: https://github.com/elastic/kibana/issues/163255
describe.skip('migration v2 - read batch size', () => {
describe('migration v2 - read batch size', () => {
let esServer: TestElasticsearchUtils;
let root: Root;
let logs: string;
Expand Down

0 comments on commit 3d254c2

Please sign in to comment.