Conversation
Azure devops
There was a problem hiding this comment.
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
FixOpensearchIndexPrefixto 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.
| 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 | ||
| } |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.