fix(os-index): idempotent delete + batched alias lookup in OSIndexAPIImpl (#36501)#36560
Open
fabrizzio-dotCMS wants to merge 1 commit into
Open
fix(os-index): idempotent delete + batched alias lookup in OSIndexAPIImpl (#36501)#36560fabrizzio-dotCMS wants to merge 1 commit into
fabrizzio-dotCMS wants to merge 1 commit into
Conversation
…Impl (#36501) Two OpenSearch index-management robustness gaps that surface under migration phase 2, where OS is the read/write primary so its errors propagate instead of being swallowed as a shadow copy. - delete(indexName) threw RuntimeException on any failure, including index_not_found. ES tolerated deleting an absent index; OS must too, otherwise phase-2 cleanup paths (e.g. ESSiteSearchAPITest reindex teardown) fail hard on a missing index. Treat index_not_found (HTTP 404) as an idempotent no-op success; all other errors still propagate. (Fixes ESSiteSearchAPITest .testFullReindexKeepsDefaultSiteSearchIndex / .testReindexAbortKeepsDefaultSiteSearchIndex under phase 2.) - getIndexAlias(List) put every index name on one _alias GET request line; with a large set (100+ site-search indices) the request exceeded OpenSearch's ~4096-byte line limit (too_long_http_line_exception), the whole lookup aborted, and a valid alias was reported as missing. Batch the lookup (ALIAS_LOOKUP_BATCH_SIZE) and merge results. (Fixes SiteSearchWebAPITest.search_byAlias_resolvesIndex under phase 2.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
3 tasks
Contributor
|
Claude finished @fabrizzio-dotCMS's task in 1m 19s —— View job Code Review
I reviewed both changes against New Issues
Notes (non-blocking)
VerdictNo blocking issues. The |
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.
Proposed Changes
Two OpenSearch index-management robustness gaps that surface under migration phase 2, where OS is read/write primary so its errors propagate. Contributes to #36501.
delete(indexName)threw on any failure, includingindex_not_found. ES tolerated deleting an absent index; OS must too, else phase-2 cleanup paths fail hard on a missing index. Now treatsindex_not_found(HTTP 404) as an idempotent no-op; other errors still propagate.getIndexAlias(List)put every index name on one_aliasGET request line; with a large set (100+ site-search indices) it exceeded OpenSearch's ~4096-byte line limit (too_long_http_line_exception), aborting the whole lookup and reporting a valid alias as missing. Now batches the lookup (ALIAS_LOOKUP_BATCH_SIZE) and merges results.Verification
Phase 2, isolated env:
ESSiteSearchAPITestreindex tests 2/0/0 (delete idempotency);SiteSearchWebAPITest#search_byAlias_resolvesIndexpasses. Note: the alias-overflow path needs 100+ indices to trigger the original bug, so the fix is exercised defensively rather than reproduced in isolation.Refs #36501, #36320.