Tags: open-metadata/OpenMetadata
Tags
fix(search): drop must_exist on remove_index so OpenSearch alias swap… … succeeds (#28700) (#29723) PR #28667 added an atomic alias swap that folds the canonical concrete-index delete into the _aliases request via a remove_index action. The action was built as removeIndex(index).mustExist(false). OpenSearch's _aliases parser does not accept must_exist on remove_index and rejects the whole request with "[remove_index] unknown field [must_exist]" -> "[aliases] failed to parse field [actions]" (HTTP 400), so the alias add in the same body never applies. Elasticsearch tolerates the field, which is why it passed review. On a fresh install every canonical *_search_index is a concrete index, so the remove_index action fires for all entities and every swap fails -> no canonical aliases are attached -> the canonical name resolves to nothing. This surfaced as the AI Platform CAIP integration test failing with "table_search_index missing embedding field". Drop must_exist from the remove_index action in both OpenSearchIndexManager and ElasticSearchIndexManager. It is unnecessary: resolveCanonicalRemoval only forwards indices already confirmed to exist via indexExists(). Both engine paths are now identical. Add AliasSwapConcreteRemovalIT, which exercises the first-install shape (concrete canonical in indicesToRemove) against the live cluster: it fails before this fix on OpenSearch and passes after. The existing DefaultRecreateHandlerTest mocks swapAliases, so it never exercised the request body where this bug lives. (cherry picked from commit d800ba4) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PreviousNext