Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow upgrading from ES6 to OpenSearch #4444

Merged
merged 24 commits into from
Feb 20, 2025
Merged

Allow upgrading from ES6 to OpenSearch #4444

merged 24 commits into from
Feb 20, 2025

Conversation

akshaymankar
Copy link
Member

@akshaymankar akshaymankar commented Feb 5, 2025

Ticket: https://wearezeta.atlassian.net/browse/WPB-16066

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Feb 5, 2025
@supersven
Copy link
Contributor

Rebased.

@supersven
Copy link
Contributor

supersven commented Feb 10, 2025

ES 7

concourse-ci/integration-tests-kube-ci with ES7

brig-index-migrate-data crash-loops with:

D, No TLS cert file path configured.
D, Connecting to 10.244.12.110:9042
I, Known hosts: [datacenter1:rack1:10.244.12.110:9042]
I, New control connection: datacenter1:rack1:10.244.12.110:9042#<socket: 71>
I, request=brig-index, Migration necessary., expectedVersion=6, foundVersion=0
D, Connection established: datacenter1:rack1:10.244.12.110:9042#<socket: 73>
D, Connection established: datacenter1:rack1:10.244.12.110:9042#<socket: 74>
brig-index: PersistVersionFailed (MigrationVersion {migrationVersion = 6}) "Response {responseStatus = Status {statusCode = 400, statusMessage = \"Bad Request\"}, responseVersion = HTTP/1.1, responseHeaders = [(\"X-elastic-product\",\"Elasticsearch\"),(\"Warning\",\"299 Elasticsearch-7.17.27-0f88dde84795b30ca0d2c0c4796643ec5938aeb5 \\\"[types removal] Specifying types in document index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, or /{index}/_create/{id}).\\\"\"),(\"content-type\",\"application/json; charset=UTF-8\"),(\"content-length\",\"259\")], responseBody = \"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"Invalid type: expecting [_doc] but got [wire_brig_migrations]\\\"}],\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"Invalid type: expecting [_doc] but got [wire_brig_migrations]\\\"},\\\"status\\\":400}\", responseCookieJar = CJ {expose = ]}, responseClose' = ResponseClose, responseOriginalRequest = Request {\n  host                 = \"elasticsearch-ephemeral\"\n  port                 = 9200\n  secure               = True\n  requestHeaders       = [(\"Authorization\",\"<REDACTED>\"),(\"Content-Type\",\"application/json\")]\n  path                 = \"/wire_brig_migrations/wire_brig_migrations/6\"\n  queryString          = \"\"\n  method               = \"PUT\"\n  proxy                = Nothing\n  rawBody              = False\n  redirectCount        = 10\n  responseTimeout      = ResponseTimeoutDefault\n  requestVersion       = HTTP/1.1\n  proxySecureMode      = ProxySecureWithConnect\n}\n, responseEarlyHints = ]}"
stream closed EOF for test-ehvzsslclb3c/brig-index-migrate-data-9hncv (brig-index)

ES 6

concourse-ci/integration-tests-kube-ci

brig-index-migrate-data crash-loops with:

D, No TLS cert file path configured.
D, Connecting to 10.244.9.179:9042
I, Known hosts: [datacenter1:rack1:10.244.9.179:9042]
I, New control connection: datacenter1:rack1:10.244.9.179:9042#<socket: 71>
I, request=brig-index, Migration necessary., expectedVersion=6, foundVersion=0
D, Connection established: datacenter1:rack1:10.244.9.179:9042#<socket: 73>
D, Connection established: datacenter1:rack1:10.244.9.179:9042#<socket: 74>
brig-index: PersistVersionFailed (MigrationVersion {migrationVersion = 6}) "Response {responseStatus = Status {statusCode = 400, statusMessage = \"Bad Request\"}, responseVersion = HTTP/1.1, responseHeaders = [(\"content-type\",\"application/json; charset=UTF-8\"),(\"content-length\",\"395\")], responseBody = \"{\\\"error\\\":{\\\"root_cause\\\":[{\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"Rejecting mapping update to [wire_brig_migrations] as the final mapping would have more than 1 type: [_doc, wire_brig_migrations]\\\"}],\\\"type\\\":\\\"illegal_argument_exception\\\",\\\"reason\\\":\\\"Rejecting mapping update to [wire_brig_migrations] as the final mapping would have more than 1 type: [_doc, wire_brig_migrations]\\\"},\\\"status\\\":400}\", responseCookieJar = CJ {expose = ]}, responseClose' = ResponseClose, responseOriginalRequest = Request {\n  host                 = \"elasticsearch-ephemeral\"\n  port                 = 9200\n  secure               = True\n  requestHeaders       = [(\"Authorization\",\"<REDACTED>\"),(\"Content-Type\",\"application/json\")]\n  path                 = \"/wire_brig_migrations/wire_brig_migrations/6\"\n  queryString          = \"\"\n  method               = \"PUT\"\n  proxy                = Nothing\n  rawBody              = False\n  redirectCount        = 10\n  responseTimeout      = ResponseTimeoutDefault\n  requestVersion       = HTTP/1.1\n  proxySecureMode      = ProxySecureWithConnect\n}\n, responseEarlyHints = ]}"
stream closed EOF for test-s2kasm620frz/brig-index-migrate-data-zxjhg (brig-index)

@supersven
Copy link
Contributor

ES 6

Integration tests succeeded: concourse-ci/integration-tests-kube-ci

akshaymankar and others added 9 commits February 14, 2025 12:15
Even better, if we can directly jump to OpenSearch.
We need
wireapp/bloodhound@9ce5c7a
to have a putMapping that is compatible with ES 6.
Ensure we didn't break backwards compatibility. It would be nice to
tests ES 6 and 7 support in parallel. However, to identify the pain
points, this is good enough.
Otherwise, there are two around. Which leads to failures.
underscore prefix

At least, OS 1.3 and ES 6 did not complain.
There may be index settings set by the ES instance itself (by default or
configuration.) So, do not expect only our settings.
@supersven
Copy link
Contributor

Rebased on develop to resolve conflicts with the Redis upgrade (6fe0220).

This is useful to flip back and forth between versions to validate with
the integration tests.
…nstance

- Make the migrationIndexName configurable to test scenarios where the
  migrations haven't run.
- Add the second index search instance's URL to config
To enable index migration tests to new instances.
The additonal ElasticSearch host is required by brig, not integration.
Otherwise, we may end up with two mappings in ES 6 and may have trouble
finding users.
The new name explains better what happens.
This contains ES 6 and ES 7 (OS 1.3) support.
@supersven supersven marked this pull request as ready for review February 19, 2025 09:54
@akshaymankar akshaymankar changed the title Upgrade Elasticsearch to 7.17.27 Allow upgrading from ES6 to OpenSearch Feb 19, 2025
@supersven supersven requested review from a team as code owners February 19, 2025 12:11
Copy link
Contributor

@supersven supersven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit odd that I'm approving, though I wrote most of the code. However, this was reviewed by @akshaymankar (who cannot approve because he initially opened this PR.)

@supersven supersven merged commit fa54154 into develop Feb 20, 2025
10 checks passed
@supersven supersven deleted the es-7 branch February 20, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants