Skip to content

Opensearch upgrade#360

Merged
yashsinghcodes merged 9 commits intomainfrom
opensearch-upgrade
Mar 25, 2026
Merged

Opensearch upgrade#360
yashsinghcodes merged 9 commits intomainfrom
opensearch-upgrade

Conversation

@yashsinghcodes
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates OpenSearch index/alias initialization and “prefix fix” logic to better handle alias collisions, rollover (including ISM when available), and multi-index alias edge cases introduced during the upgrade.

Changes:

  • Refactors FixOpensearchIndexPrefix to repair alias/write-index state (and optionally ensure ISM rollover policy + settings) without full reindexing.
  • Introduces GetOpensearchBaseIndexes() and updates OpenSearch index init to use it, plus adds ISM policy bootstrapping and alias verification.
  • Adds alias-search fallbacks for document fetch/delete when OpenSearch reports aliases spanning multiple indices; centralizes workflow image size trimming.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
structs.go Expands the prefix-fix result payload to report alias verification and migration/creation actions.
health.go Reworks prefix-fix flow with alias/index discovery helpers, collision handling, and optional ISM attachment/verification.
db-connector.go Adds base-index list, alias-search fallbacks for reads/deletes, workflow image trimming helper, and ISM rollover policy/index settings support.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3848 to +3852
func checkOpensearchIndexExists(foundClient opensearchapi.Client, opensearchUrl, indexName string) (bool, error) {
req, err := http.NewRequest("GET", fmt.Sprintf("%s/%s", opensearchUrl, indexName), nil)
if err != nil {
return false, err
}
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

checkOpensearchIndexExists uses a GET on /{index} to test existence, which fetches index metadata and can be expensive; it also forces reading the whole response body. Prefer a HEAD request (or the client’s indices exists API) to reduce payload and latency when this runs across many indexes.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@yashsinghcodes yashsinghcodes merged commit 4ea5365 into main Mar 25, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants