Skip to content

Add batch failover/relocate modal with progress tracking - #2982

Open
vbnrh wants to merge 1 commit into
red-hat-storage:masterfrom
vbnrh:rhstor-6407-batch-failover-relocate
Open

Add batch failover/relocate modal with progress tracking#2982
vbnrh wants to merge 1 commit into
red-hat-storage:masterfrom
vbnrh:rhstor-6407-batch-failover-relocate

Conversation

@vbnrh

@vbnrh vbnrh commented Jul 21, 2026

Copy link
Copy Markdown
Member

Description

Implements batch failover/relocate for protected applications (RHSTOR-6407 + RHSTOR-6408), part of the RHSTOR-5643 epic.

Action selection modal (RHSTOR-6407):

Wires the Failover/Relocate toolbar button to open a modal when apps are selected
Two selectable card tiles (Failover / Relocate) with radio-like single-select behavior
Initiate button disabled until an action is chosen; Cancel closes without side effects
Batch execution with progress (RHSTOR-6408):

On Initiate, modal transitions to a progress view with a live progress bar
Patches all selected DRPCs concurrently, progress bar fills as each patch settles
On success: clears selection, closes modal, DR Status column auto-updates via k8s watch
On partial failure: closes modal, shows a dismissible warning alert ("X of Y applications were unable to begin relocating/failing over") with a Retry button that re-launches the modal for only the failed DRPCs


Change Type

Please select all applicable options:

  • Feature
  • Bug Fix
  • Improvement
  • Refactor
  • Tests

Component / Area Impacted

Please select all applicable options:

  • ODF
  • FDF
  • Client
  • MCO
  • Fusion Access (SAN Storage)
  • CNSA (Remote Mount)
  • E2E Test

Screenshots / Recordings

Screenshots

image
Screen.Recording.2026-07-21.at.11.45.42.AM.mov

Testing

Please select the type of tests included:

  • Unit Tests
  • E2E Tests
  • No Tests Required (with justification below)

…ress tracking

Wire the Failover/Relocate toolbar button to open a batch action
selection modal. Users pick Failover or Relocate via selectable cards,
then Initiate patches all selected DRPCs concurrently with a live
progress bar. Partial failures surface as a dismissible warning alert
with a Retry option.

Signed-off-by: vbadrina <vbadrina@redhat.com>
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vbnrh
Once this PR has been reviewed and has the lgtm label, please assign bipuladh for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@vbnrh: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws 2e0bee3 link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci

openshift-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

value: action === DRActionType.FAILOVER ? targetCluster : primaryCluster,
},
{
op: 'replace' as const,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
op: 'replace' as const,
op: 'replace',

const { t } = useCustomTranslation();

const [selectedAction, setSelectedAction] =
React.useState<DRActionType | null>(null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
React.useState<DRActionType | null>(null);
React.useState<DRActionType>(null);

Isn't null compatible with all types?

}

onComplete();
closeModal();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we close the modal after failures as well?

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator

We previously discussed adding a cap on the maximum number of user selections (e.g: 30 or 50 apps, based on the throttling tests). What happened to that ??

Comment on lines +94 to +103
selectedDRPCs.map((drpc) =>
k8sPatch({
model: DRPlacementControlModel,
resource: {
metadata: {
name: getName(drpc),
namespace: getNamespace(drpc),
},
},
data: buildDRPCPatch(drpc, selectedAction),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of "N" API calls in parallel (which could be very large value, even with the capping), make calls in batch of 6, once completed, start with next batch.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SanjalKatiyar

Copy link
Copy Markdown
Collaborator

image

minor styling issue, radio cards should be center-ed, too much spacing of the right section of the modal...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants