From 82600750b03f1d43c33e8a19308cb8143c273422 Mon Sep 17 00:00:00 2001 From: Jethro Mak <88681329+Jethro-M@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:25:33 -0400 Subject: [PATCH] [PLAT-15079] Treat dropped on target tables as unconfigured but preselected Summary: **Context** We have added a change to set DroppedFromTarget status for tables which are dropped from the target universe only here: 1655e697d49f57cf4225da78af6158c3c89cddc4 On the YBA UI, we need to be including these tables in our bootstrap requirement check because they will require a bootstrap to be added back to replication due to missing table on target. **Change** On the YBA UI, we will consider tables which are dropped on the target as unconfigured, but preselected. This means we will preselect the table when users go to the edit table modal, but also treat the table as unconfigured and send it along for the need bootstrap check. This will allow the backend to return the detailed need bootstrap response for these tables which will be presented on the bootstrap summary page. This diff also hides the 'no full copy planned' category box if there are no groups of tables which meet this category definition. Test Plan: Create an xCluster config. - Drop a table only on the target universe. - Add an empty table to both the source and target universe. - Add the new empty table to replication. - Verify that the bootstrap summary page indicates we require a full copy (aka bootstrap) for the table which was dropped only on the target. {F284195} {F284243} Reviewers: vbansal, hzare, cwang, rmadhavan, kkannan, lsangappa Reviewed By: hzare Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D37949 --- managed/ui/src/components/xcluster/constants.ts | 4 +++- .../disasterRecovery/editTables/EditTablesModal.tsx | 3 +++ .../bootstrapSummary/BootstrapSummary.tsx | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/managed/ui/src/components/xcluster/constants.ts b/managed/ui/src/components/xcluster/constants.ts index e934e6d40195..084792b7ff5c 100644 --- a/managed/ui/src/components/xcluster/constants.ts +++ b/managed/ui/src/components/xcluster/constants.ts @@ -65,7 +65,9 @@ export const SOURCE_MISSING_XCLUSTER_TABLE_STATUSES: readonly XClusterTableStatu export const UNCONFIGURED_XCLUSTER_TABLE_STATUSES: readonly XClusterTableStatus[] = [ XClusterTableStatus.EXTRA_TABLE_ON_SOURCE, - XClusterTableStatus.EXTRA_TABLE_ON_TARGET + XClusterTableStatus.EXTRA_TABLE_ON_TARGET, + XClusterTableStatus.DROPPED, + XClusterTableStatus.DROPPED_FROM_TARGET ]; export const DROPPED_XCLUSTER_TABLE_STATUSES: readonly XClusterTableStatus[] = [ diff --git a/managed/ui/src/components/xcluster/disasterRecovery/editTables/EditTablesModal.tsx b/managed/ui/src/components/xcluster/disasterRecovery/editTables/EditTablesModal.tsx index 22d11265b730..a1b36025779a 100644 --- a/managed/ui/src/components/xcluster/disasterRecovery/editTables/EditTablesModal.tsx +++ b/managed/ui/src/components/xcluster/disasterRecovery/editTables/EditTablesModal.tsx @@ -539,6 +539,9 @@ export const classifyTablesAndNamespaces = ( tableUuidsDroppedOnSource.add(tableUuid); return; case XClusterTableStatus.DROPPED_FROM_TARGET: + // We treat tables which are dropped on the target as unconfigured but preselected. + // This means there is no action needed from the user. We will be checking the bootstrapping requirement + // and just adding the table to the config (unless the user deselects the table of course). if (sourceTableInfo) { selectedTableUuids.add(getTableUuid(sourceTableInfo)); selectedNamespaceUuid.add(namespaceToNamespaceUuid[sourceTableInfo.keySpace]); diff --git a/managed/ui/src/components/xcluster/sharedComponents/bootstrapSummary/BootstrapSummary.tsx b/managed/ui/src/components/xcluster/sharedComponents/bootstrapSummary/BootstrapSummary.tsx index 1baf4bde34b7..f3328b2aa5d9 100644 --- a/managed/ui/src/components/xcluster/sharedComponents/bootstrapSummary/BootstrapSummary.tsx +++ b/managed/ui/src/components/xcluster/sharedComponents/bootstrapSummary/BootstrapSummary.tsx @@ -148,6 +148,10 @@ export const BootstrapSummary = (props: ConfigureBootstrapStepProps) => { const isPossibleDataInconsistencyPresent = (bootstrapTableUuids.length > 0 && skipBootstrap) || numTablesRequiringBootstrapInBidirectionalDb > 0; + const noBootstrapPlannedTableCount = noBootstrapPlannedCategories.reduce( + (tableCount, category) => tableCount + category.tableCount, + 0 + ); // Defining user facing product terms here. const sourceUniverseTerm = t(`source.${props.isDrInterface ? 'dr' : 'xClusterReplication'}`, { @@ -213,7 +217,7 @@ export const BootstrapSummary = (props: ConfigureBootstrapStepProps) => { )} -
+ {noBootstrapPlannedTableCount > 0 && (
{t('categoryGroup.noBootstrapPlanned')}
@@ -230,7 +234,7 @@ export const BootstrapSummary = (props: ConfigureBootstrapStepProps) => { ))}
-
+ )} {bootstrapTableUuids.length > 0 && !skipBootstrap && (
{t('categoryGroup.bootstrapPlanned')}