fix: call replication/failback on target cluster/pool/volume resolved… - #472
Open
geoffrey1330 wants to merge 16 commits into
Open
fix: call replication/failback on target cluster/pool/volume resolved…#472geoffrey1330 wants to merge 16 commits into
geoffrey1330 wants to merge 16 commits into
Conversation
… via relationship lookup
…t cluster/pool/volume
… completes in reconcileSyncStatus
…Over constant to satisfy goconst
…e target cluster during failback
…er states with is_source check in reconcileReplicating
… and add failback path coverage
…econnect, mirroring migration
…led_over revert on per-cluster FDB
… cluster and ignoring stale source state
…get cluster where cutover_pending record lives
…ath, fast-requeue stale case, and persist annotation deletions
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.
… via relationship lookup
fix: failback correctness — slot flip-flop, DeleteSource, and test coverage
Problem
After a failover, triggering a failback left volumes stuck or oscillating:
FailedOver—reconcileSyncStatushad no handler forcutover_done/failed_overwithis_source: false, so the slot never transitioned back toreplicating/source.reconcileReplicatingunconditionally setcutover_done/targetwhen it saw a done state, racing againstreconcileSyncStatusand causing infinite oscillation between the two states.do_replicatenot restored — the original source lvol haddo_replicatecleared during failover;_swap_failback_lvol_uuidblindly copied thatFalsevalue, so replication never resumed after failback.Solution
is_source: falsedetection in bothreconcileSyncStatusandreconcileReplicating— when the backend reports a terminal cutover state withis_source: false, both paths now agree to writereplicating/source, stopping the oscillation.DeleteSourceto cover failback: deletes the failed-over volume on the target cluster when set (previously only worked for migration).do_replicate = trueand replication cadence config from the failback source after UUID swap.backendStateFailedOverconstant (goconst lint).Tests
TestSlot_ReconcileReplicating_FailedOver_UpdatesStateandTestSlot_ReconcileReplicating_DetectsCutoverDone_SetsDirectionTarget— both hadIsSource: falsebut were testing the forward failover path; corrected toIsSource: true.TestSlot_ReconcileReplicating_CutoverDone_Failback_SetsReplicatingSourceandTestSlot_ReconcileReplicating_FailedOver_Failback_SetsReplicatingSourcecovering theis_source: false→replicating/sourcepath.Test plan
go test ./internal/controller/...greendeleteSource: trueremoves the failed-over target volume (targetLvolIDchanges post-failback)kubectl get replicationslot -w