fix(cephfs): stabilise volume replication disable#746
Open
UtkarshBhatthere wants to merge 1 commit into
Open
Conversation
The CephFS volume-level disable (`replication disable cephfs --volume X --force`) periodically tripped the 120s client deadline in CI because: - Each path's `ceph fs snapshot mirror remove` blocks until the cephfs-mirror daemon acknowledges removal. If a sync is mid-flight, a single path can stall long enough that the four-path loop exceeds the client budget. - The disable path had no retries, unlike the RBD pool disable (`microceph/ceph/rbd_mirror.go:213`). Mirror the RBD pattern and add a pre-flight stability check: - `cephFSWaitForMirrorPathsIdle` polls every peer's per-path status (12 × 5s linear backoff) and returns `mirror path not stable: <path>` if any path stays non-idle, so the operator sees the offending path instead of a generic deadline error. - `disableCephFSVolumeMirror` now wraps `cephFSSnapshotMirrorRemovePath` in `retry.Retry` (10 × 5s linear), absorbing transient daemon errors. - CLI prints an early notice on volume-level force disable so the operator does not perceive the up-to-60s wait as a hang. - `cephfs-replication-test` workflow job gains an `if: failure()` log-dump step (snap logs, mirror daemon status, replication status, ceph.conf per node) so the next flake leaves enough evidence behind to identify the slow ceph CLI invocation. Unit tests cover idle / never-stable / missing-path / late-stabilise / fetcher-error / multi-peer-one-non-idle / empty-input cases. Assisted-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Utkarsh Bhatt <utkarsh_bhatt@outlook.com>
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.
Summary
The CephFS volume-level disable (
microceph replication disable cephfs --volume X --force) periodically tripped the 120s client deadline in CI (e.g. run 26505076454 job 78056192583):Two missing pieces vs. the RBD path:
ceph fs snapshot mirror removeblocks until the cephfs-mirror daemon ACKs the removal. With four paths and an in-flight sync, the loop can exceed the client deadline.microceph/ceph/rbd_mirror.go:213) does.Changes
microceph/ceph/replication_cephfs.gocephFSWaitForMirrorPathsIdle: pre-flight check that polls every peer's per-path status (12 × 5s linear backoff). Returnsmirror path not stable: <path>naming the offending path if any path stays non-idle, instead of a generic timeout.disableCephFSVolumeMirror: wrapscephFSSnapshotMirrorRemovePathinretry.Retry(10 × 5s linear), mirroring the RBD pattern.buildPeerStatusFetchers: resolvesvolumeID + peers + admin socketonce inDisableHandlerand returns one closure per peer; keeps the pre-wait testable.microceph/cmd/microceph/replication_disable_cephfs.go: prints an earlyChecking mirror path stability before disabling replication; this may take up to a minute...notice on volume-level force disable so the operator does not perceive the up-to-60s wait as a hang. Gated on--force+ no--subvolume+ no--dir-pathso subvolume/directory disables (which don't pre-wait) stay silent.microceph/ceph/replication_cephfs_test.go: 7 unit tests covering all-idle, never-stabilises, missing-path, late-stabilise, fetcher-error, multi-peer-one-non-idle, and empty-input cases. Test temporarily shrinks the attempt count + backoff so the suite stays fast..github/workflows/tests.yml: adds anif: failure()log-dump step to thecephfs-replication-testjob (snap logs, cephfs-mirror logs,ceph -s,fs snapshot mirror daemon status,replication status,ceph.confper node) so the next flake leaves the evidence needed to identify whichcephinvocation actually hangs.Test plan
go build ./...cleango vet ./ceph/...cleango test ./ceph/... -run TestCephFSWait -v— 7/7 passgo test ./...— all packages pass🤖 Generated with Claude Code