Repository navigation
fix(rgw): make RGW disable converge when repeated or interrupted - #887
Open
johnramsden wants to merge 2 commits into
Open
johnramsden wants to merge 2 commits into
johnramsden wants to merge 2 commits into
Conversation
johnramsden
added this pull request to stack #894
September 23, 2026 04:20
This was referenced Sep 23, 2026
This was referenced Sep 23, 2026
johnramsden
marked this pull request as ready for review
September 23, 2026 04:30
johnramsden
force-pushed
the
rgw-stack/07-disable
branch
from
September 23, 2026 18:19
d506027 to
461478b
Compare
johnramsden
force-pushed
the
rgw-stack/07-disable
branch
from
September 24, 2026 19:32
461478b to
ab69d32
Compare
johnramsden
force-pushed
the
rgw-stack/07-disable
branch
2 times, most recently
from
September 29, 2026 19:50
02a3a1e to
3c82483
Compare
sabaini
requested changes
Sep 30, 2026
johnramsden
added a commit
that referenced
this pull request
Oct 1, 2026
Use Lstat so a dangling symlink cannot satisfy the cleanup assertion. Review: #887 (comment) Assisted-by: omp:openrouter/openai/gpt-6-astra Signed-off-by: John Ramsden <john.ramsden@canonical.com>
johnramsden
force-pushed
the
rgw-stack/07-disable
branch
from
October 1, 2026 18:07
3c82483 to
0d9089a
Compare
DisableRGW in ceph/rgw.go returned at the first file that was already missing, and removeServiceDatabase in ceph/services.go returned an error when the services row was already gone. Disabling RGW is not one atomic step: stopping the snap service, dropping two database rows, and deleting several files can each fail independently, and a disable interrupted partway, or simply repeated, could therefore never finish. DisableRGW now takes serviceStartMu for the whole teardown, matching every other path that starts, stops or reconfigures a service on the member, and follows a fixed order: stop the service, drop the record, only then delete files. The record is dropped before any file so a failure there leaves files and record consistent, a well-defined point for a retry to resume from, and every removal past that point tolerates a file already being gone (removeIgnoreMissing or os.RemoveAll) instead of failing at the first one. Remaining failures are collected rather than returned on the first hit, so a retry sees and fixes everything left over in one pass instead of one file per call, then joined into one error and wrapped in ErrPlacementOperationFailed. removeServiceDatabase treats a NotFound from database.DeleteService as success, but only for the "rgw" service: mon, mgr and mds keep the strict behaviour, since an absent row for those means a real inconsistency, not a convergent retry, and still fail loudly. deleteServiceRecordFunc and deleteRGWFrontendFunc are injectable so this can be tested without dqlite. This makes DisableRGW convergent at the unit level only; nothing yet calls it from a reconciliation loop, and nothing exercises it against a real snap. "feat(placement): reconcile RGW across the cluster" dispatches removal through this same path and relies on the guarantee added here, and the suite added in "test(robot): add the single-VM RGW placement suite" exercises the partial-cleanup and repeat cases live. Co-authored-by: Peter Sabaini <peter.sabaini@canonical.com> Assisted-by: claude-code:claude-fable-5-1 Assisted-by: pi:gpt-6-astra Signed-off-by: John Ramsden <john.ramsden@canonical.com>
Use Lstat so a dangling symlink cannot satisfy the cleanup assertion. Review: #887 (comment) Assisted-by: omp:openrouter/openai/gpt-6-astra Signed-off-by: John Ramsden <john.ramsden@canonical.com>
johnramsden
force-pushed
the
rgw-stack/07-disable
branch
from
October 6, 2026 00:47
0d9089a to
6443956
Compare
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
DisableRGWreturned at the first file that was already missing, andremoveServiceDatabasereturned an error when the services row was already gone. Disabling RGW is not one atomic step: stopping the snap service, dropping two database rows, and deleting several files can each fail independently, and a disable interrupted partway, or simply repeated, could therefore never finish.DisableRGWnow takesserviceStartMufor the whole teardown, matching every other path that starts, stops or reconfigures a service on the member, and follows a fixed order: stop the service, drop the record, only then delete files. The record is dropped before any file so a failure there leaves files and record consistent — a well-defined point for a retry to resume from — and every removal past that point tolerates a file already being gone instead of failing at the first one. Remaining failures are collected rather than returned on the first hit, then joined into one error and wrapped inErrPlacementOperationFailed.removeServiceDatabasetreats a not-found fromdatabase.DeleteServiceas success, but only for thergwservice: mon, mgr and mds keep the strict behaviour, since an absent row for those means a real inconsistency, not a convergent retry.Stack: PR 7 of 13. Merge in order. Each PR is one logical change on top of the one before it.
Reviewer note: this makes
DisableRGWconvergent at the unit level only; nothing yet calls it from a reconciliation loop, and nothing exercises it against a real snap.09-reconciledispatches removal through this same path, and the Robot suite in10-robot-singleexercises the partial-cleanup and repeat cases live.Type of change
How has this been tested?
Contributor checklist
Please check that you have: