Conversation
0aab721 to
7338fbe
Compare
| params[self.component.backup_id_param] = latest | ||
|
|
||
| try: | ||
| tenacity.Retrying( |
There was a problem hiding this comment.
I found a race condition during a MySQL component restore. After the corresponding control-plane service is paused, there is a brief window during which MySQL may have dangling client connections, so the restore action will fail to close them. Having a retry here solves the issue, but I would like to come up with something more robust and reliable. Open to suggestions
There was a problem hiding this comment.
issue: I find this aggressive retry policy a bit concerning.
Was this tested with applications unpaused?
c1983b3 to
434862a
Compare
gboutry
left a comment
There was a problem hiding this comment.
I think this PR needs another pass with a more holistic view of the backup and restore workflows.
There is a lot of indirection, which makes the operational sequence and its safety properties difficult to reason about. In particular, BackupComponent does not appear to simplify the implementation: component-specific behavior still leaks into generic steps, especially around action parameters, point-in-time restore, pause/resume coordination, and failure recovery.
The force handling illustrates the problem. It is propagated through several layers without a clear definition of what it is supposed to bypass. In some paths it has no effect, while in others it becomes an action parameter even when the target charm does not support that parameter. This makes --force both unreliable and capable of breaking otherwise valid operations.
Before adding more fixes, I think we should simplify the design around explicit MySQL and Vault workflows, define the guarantees for backup, restore, rollback, and force behavior, and then test those workflows against the actual charm action contracts and supported database topologies. The current mock-heavy tests pass while still encoding assumptions that are invalid with Juju.
| params[self.component.backup_id_param] = latest | ||
|
|
||
| try: | ||
| tenacity.Retrying( |
There was a problem hiding this comment.
issue: I find this aggressive retry policy a bit concerning.
Was this tested with applications unpaused?
| return sorted(successful, key=lambda b: b.backup_id)[-1].backup_id | ||
|
|
||
|
|
||
| def _api_app_for_mysql(app_name: str) -> str: |
There was a problem hiding this comment.
The default MySQL topology is single MySQL app, and if we follow this Pull request, then, to which application is mysql tied to?
|
@gboutry I've refactored the logic:
The 80c3324 commit should address all comments and change requests above |
|
@hemanthnakkina I don't usually resolve the comments by myself, and they are from @gboutry. Should I resolve? |
Atleast leave a comment against each conversation thread so that we know the comments are handled |
|
@hemanthnakkina I've tried to handle requests in the latest commit, #876 (comment) |
80c3324 to
9ddff30
Compare
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
9ddff30 to
1e32c98
Compare
There was a problem hiding this comment.
Two restore defects found at this revision; details inline. The 92 targeted backup/restore unit tests passed using the project's native uv invocation. Separate mocked reproductions confirmed the uncaught exception paths and the stale-unit backup lookup.
| params = self.component.restore_params( | ||
| self.jhelper, | ||
| self.target, |
There was a problem hiding this comment.
[P2] Use the refreshed leader for the backup lookup
The leader is refreshed at line 467, but restore_params() still receives the original self.target. For a latest-backup restore, latest_backup_params() runs list-backups on that original target.unit. If scale-down removed the previously selected leader, backup lookup targets a removed unit and fails before the restore action, which correctly uses the refreshed leader. Pass a target containing the refreshed leader when resolving backup parameters. A mocked leader-change reproduction confirmed list-backups targets the old unit while restore targets the refreshed leader.
Signed-off-by: Deezzir <yurii.kondrakov@canonical.com>
hemanthnakkina
left a comment
There was a problem hiding this comment.
Overall LGTM, minor comments inline
gboutry
left a comment
There was a problem hiding this comment.
Is there a plan for acceptance suite test integration?
|
@hmlanigan @gboutry I don't completely understand what is being requested and why was it put on hold |
Overview
sunbeam backup,sunbeam list-backups, andsunbeam restorecommands for stateful workloads in the OpenStack model.BackupComponent) so command flow is generic while component specifics (target resolution, parse/list/restore plans) stay in one registry.Automation
In addition to the new commands, I am working on an experimental feature to automate the deployment and configuration of the
s3-integratorcharm for each MySQL and Vault component detected in the cluster. The branch is currently based on the current changes.See: #890
The feature, at a minimum, deploys the
s3-integratorfor each target application, but the operator can choose to interactively set up the S3 location (single for all integrators).Prerequisites
The current changes are blocked by the
sunbeam-charmsfeature introduced in the PR, adding thepause/resumeactions for the control plane services, likekeystone,cinder, etc. The feature allows stopping the control-plane service's communication with the corresponding databases, so the restore can complete without concurrent writes.QA
The new commands were validated end-to-end on a new Sunbeam Cluster (MAAS) on the personal SE-Cloud.
Demo
Backup
List Backups
Restore