DRPC API Extension: Add dryRun spec to extend TestFailover action#2416
DRPC API Extension: Add dryRun spec to extend TestFailover action#2416BenamarMk merged 11 commits intoRamenDR:mainfrom
Conversation
577b2df to
dcaf8c5
Compare
| } | ||
| } | ||
|
|
||
| func (d *DRPCInstance) convertStateForTestIfNeeded(nextState rmn.DRState) rmn.DRState { |
There was a problem hiding this comment.
Change the function name to be something like adjustPhaseIfTestFailover
| return nextState | ||
| } | ||
|
|
||
| func getTestFailoverPhase(nextState rmn.DRState) rmn.DRState { |
There was a problem hiding this comment.
and how about this one? I would change it to mapPhaseForTestFailover.
In that case, you would get something like:
adjustPhaseIfTestFailover --> mapPhaseForTestFailover
One is conditional, the other one is basically do it
24c4987 to
660c4b6
Compare
| ProgressionDeleting = ProgressionStatus("Deleting") | ||
| ProgressionDeleted = ProgressionStatus("Deleted") | ||
| ProgressionActionPaused = ProgressionStatus("Paused") | ||
| ProgressionTestFailover = ProgressionStatus("TestingFailover") |
There was a problem hiding this comment.
Keep the same patter naming. The progression variable is named as: Progression + progression name.
so use ProgressionTestingFailover instead of ProgressionTestFailover.
42b70e4 to
fda537b
Compare
|
@am-agrawa I pushed two commits. One fixes a bug I ran into, and the other adds support for the I tested the following order:
All of them return to the previous action cleanly after an |
0b09a0a to
bb49337
Compare
bb49337 to
0b09a0a
Compare
bb49337 to
db88f3c
Compare
1abfd99 to
77ce786
Compare
| rule: self == oldSelf | ||
| dryRun: | ||
| description: |- | ||
| DryRun when set to true, makes the action (Failover or Relocate) non-destructive. |
There was a problem hiding this comment.
| DryRun when set to true, makes the action (Failover or Relocate) non-destructive. | |
| DryRun when set to true, makes the Failover action non-destructive. |
99427cd to
948d474
Compare
5b7b4ee to
7604973
Compare
7604973 to
9759580
Compare
Implements issue RamenDR#404 - Add commands to manage dry-run failover testing. This adds two commands: - `ramenctl failover dry-run`: Test failover to secondary cluster without affecting the primary application - `ramenctl failover dry-run --abort`: Revert the dry-run and return to original state The implementation: - Uses Ramen's dryRun field in DRPlacementControlSpec - Relies on last-action label for safe state restoration - Supports all three pre-dry-run states: Deployed, FailedOver, Relocated - Includes comprehensive error handling and user feedback IMPORTANT: This code requires Ramen PR #2416 to be merged first. The DryRun field is not yet available in the current Ramen API version. Reference: RamenDR/ramen#2416 Closes: RamenDR#404 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements issue RamenDR#404 - Add commands to manage dry-run failover testing. This adds two commands: - `ramenctl failover dry-run`: Test failover to secondary cluster without affecting the primary application - `ramenctl failover dry-run --abort`: Revert the dry-run and return to original state The implementation: - Uses Ramen's dryRun field in DRPlacementControlSpec - Relies on last-action label for safe state restoration - Supports all three pre-dry-run states: Deployed, FailedOver, Relocated - Includes comprehensive error handling and user feedback IMPORTANT: This code requires Ramen PR #2416 to be merged first. The DryRun field is not yet available in the current Ramen API version. Reference: RamenDR/ramen#2416 Closes: RamenDR#404 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
3134fcd to
faffdb6
Compare
Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
…preserve conditions Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
Introduce non-destructive TestFailover action to verify secondary cluster readiness without committing to failover. - Add VRGActionTestFailover and update CRD enums/YAML - Implement placement logic, cleanup, and action execution refactor - Exclude test primaries from multi-primary checks - Restore original placement decisions after test failover - Treat TestFailover like Failover for resync and VolSync restore - Skip LastAppDeploymentCluster updates during test failover - Improve comments, readability, and lint compliance Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
Replace the separate ActionTestFailover action type with a simpler attribute-based approach using a DryRun boolean field. This cleaner design separates concerns: - Action Failover indicates the operation to perform - DryRun boolean indicates if the operation should be non-destructive/test mode - Progression status (TestingFailover) continues to indicate test mode Changes: - Remove ActionTestFailover from DRAction and VRGAction enums - Remove TestFailover and TestFailedOver DRState constants - Add DryRun field to DRPlacementControlSpec and VolumeReplicationGroupSpec - Update all references to ActionTestFailover to check DryRun flag instead The progression status ProgressionTestingFailover is retained as it provides a unified indicator of test mode across both DRPC and VRG resources. Signed-off-by: Benamar Mekhissi <bmekhiss@ibm.com>
- Upload continues from the primary managed cluster to S3 stores on both sides - Upload stops from the failoverCluster on both S3 when dryRun is set to True when action is Failover Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
…pport - VolumeSnapshots are taken during dryRun for RBD PVCs - VolumeSnapshots are cleaned when dryRun is reverted, or test failover is promoted to a real failover - Use specific dry-run-snapshot label to identify and delete those snapshots - Implement VRG-specific snapshot creation and cleanup during test failover with proper workload isolation using labels, ensuring snapshots are managed across all namespaces for multi-namespace deployments - Enable autoResync on Primary VRG during real failover to allow data sync from new primary to old primary (now secondary) after promoting from test to real failover - Add support for reverting test failover without FailoverCluster specified, keeping VRGs as Primary on both sides and preserving snapshots until FailoverCluster is provided for real failover promotion Assisted by AI Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
VRG Tests (10 tests - vrg_volrep_dryrun_test.go): - Snapshot creation during dry-run failover (Primary VRG only) - Snapshot cleanup on abort (Secondary transition) and promotion (DryRun→false) - CephFS PVC filtering - Idempotency and label-based selection DRPC Tests (6 tests - drplacementcontrol_dryrun_test.go): - DryRun field defaults and transitions - DryRun compatibility with Failover and Relocate actions Test infrastructure includes VolumeReplicationClass, StorageID labels, and PeerClasses for reliable execution in envtest. Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
…DRPC to report it after failover Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
faffdb6 to
cfdcdc4
Compare
- Optimize dry-run snapshot cleanup to avoid expensive List() calls - Fix lint issues and other failures Assisted by AI Signed-off-by: Aman Agrawal <aman_31dec@yahoo.in>
cfdcdc4 to
2ea1128
Compare
|
I approved, e2e is failing. We'll merge once fixed. |
No description provided.