Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds rollback-safety mechanics for OpenSearch upgrades by introducing a compatibility matrix, enforcing rollback compatibility checks, and providing a manual override action intended to help operators recover from otherwise-blocked rollback scenarios.
Changes:
- Added rollback detection + compatibility gating logic, backed by a persisted compatibility matrix.
- Introduced a new operator action (
force-refresh-start) to force a rollback recovery path by overriding the on-disk OpenSearch version. - Updated upgrade/rollback flows to toggle additional cluster settings (including
action.auto_create_index) and updated integration rollback recovery helper accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/upgrades/helpers.py | Updates rollback recovery helper to also restore action.auto_create_index. |
| src/upgrade.py | Adds rollback detection and compatibility-matrix-based rollback allowance checks. |
| src/machine_upgrade.py | Adds action constant and adjusts rollback/upgrade cluster-setting reset behavior. |
| src/charm.py | Wires the new action and adds rollback gating + operator messaging to upgrade reconciliation. |
| lib/charms/opensearch/v0/opensearch_distro.py | Adds compatibility matrix file path + read/write helpers and an override-version command wrapper. |
| lib/charms/opensearch/v0/opensearch_base_charm.py | Extends upgrade event payload to include override_version, reconciles the compatibility matrix, and adds auto-index setting toggles around upgrade. |
| actions.yaml | Defines the new force-refresh-start action and its parameters/documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description of issue or feature:
Rollbacks are not supported on OpenSearch.
Solution:
This pull request introduces a controlled rollback override mechanism for OpenSearch upgrades, improves upgrade safety by enforcing compatibility checks, and adds infrastructure for managing a compatibility matrix. The changes ensure that rollbacks are only allowed when explicitly supported, and provide a manual override action for exceptional cases, along with robust logging and error handling.
Rollback and upgrade safety enhancements:
force-refresh-startaction that allows operators to manually override the OpenSearch version on disk to enable a rollback, with warnings about potential data loss and downtime. This action is only available when a rollback is in progress and the unit is outdated. [1] [2] [3] [4]Compatibility matrix management:
compatibility_matrix.json) to record supported upgrade and rollback paths. The matrix is reconciled at startup and used to determine if a rollback is supported. [1] [2] [3] [4]OpenSearch upgrade/rollback mechanics:
override_versionflag, and implemented logic to call the OpenSearchoverride-versioncommand when this flag is set, with error handling and logging. [1] [2]How was this change tested?
Checklist