Repository navigation
Recognize OpenSearch in Elasticsearch compatibility mode - #162
Merged
Merged
Conversation
With compatibility.override_main_response_version, which AWS OpenSearch Service domains often enable, GET / reports Elasticsearch 7.10.2 with no distribution or build flavor, so Weir refused to start. The OpenSearch tagline still identifies it. CI now also runs the integration and process suites against OpenSearch 2.17.1 in that mode.
- qualify() also requires version 7.10.2, and the unit table adds the near misses - the compat fixtures check the node release, which compatibility mode does not rewrite - the 2.17 skip names CVE-2025-9624; docs describe detection exactly
…ibility-mode # Conflicts: # docs/configuration.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AWS OpenSearch Service domains often enable
compatibility.override_main_response_versionso Elasticsearch 7.10 clients keep working. In that modeGET /reports version7.10.2with nodistributionand nobuild_flavor.qualify()accepts onlydistribution: opensearchor Elasticsearchbuild_flavor: default, so Weir refused to start with "unsupported Search server product". A production OpenSearch 2.17 domain answers like this (account and node names removed):{"version":{"number":"7.10.2","build_type":"tar","build_hash":"unknown","build_snapshot":false,"lucene_version":"9.11.1","minimum_wire_compatibility_version":"7.10.0","minimum_index_compatibility_version":"7.0.0"},"tagline":"The OpenSearch Project: https://opensearch.org/"}qualify()now also accepts a root with version7.10.2, no distribution, no build flavor and exactly the OpenSearch tagline, and uses the OpenSearch dialect for it. Elasticsearch, including 7.10 OSS (build_flavor: oss) and any root with the Elasticsearch tagline, is still accepted or rejected as before. The unit table adds this response and its near misses.Weir's fixtures had moved to OpenSearch 3.3 (2.19.x until 70ddb58) and none ran compatibility mode, so this adds a third fixture:
scripts/search-local.sh start opensearch-compatruns OpenSearch 2.17.1 with the compatibility setting on port 19203, andWEIR_SEARCH_PRODUCT=opensearch-compatselects it. The secure (HTTPS and basic-auth security plugin) fixture uses the same image and setting. Because the root reports 7.10.2, both fixtures also check thatGET /_nodes/_localreports 2.17.1. The Go fixtures share one table ininternal/testutil/testsearch/backend.go;scripts/search-local.shkeeps its own copy of the names, ports, digests and identity checks. CI addsopensearch-compatto the integration and process-integration matrices.Run locally against the new fixture (MongoDB 8.0.32):
go test -race -p=1 -tags=integration ./...with the normal profile passes, apart from the two fixture expectations changed below.rejected_execution_exceptionis recognized.Two fixture expectations changed for 2.17:
TestSecureSearchQualification: OpenSearch 2.17 returns the same unstructuredtext/plain401 as 3.3, so the 401 cases expect the sameUNKNOWNoutcome.TestSearchSecurityInputBoundaryskips this profile. It probes OpenSearch's ownsearch.query.max_query_string_length, which does not exercise Weir. That limit is the fix for CVE-2025-9624 (aquery_stringdenial of service) and first shipped in 2.19.4, so this profile is a known-unpatched build. It is pinned to 2.17 because that is the production domain's version.The new CI checks are not yet required by branch protection. README,
docs/configuration.md(product detection) anddocs/development.md(the fixture) are updated.