diff --git a/web/vtadmin/src/components/routes/workflow/Workflow.tsx b/web/vtadmin/src/components/routes/workflow/Workflow.tsx index ef81bb40c25..6682494c482 100644 --- a/web/vtadmin/src/components/routes/workflow/Workflow.tsx +++ b/web/vtadmin/src/components/routes/workflow/Workflow.tsx @@ -30,6 +30,7 @@ import { TabContainer } from '../../tabs/TabContainer'; import { Tab } from '../../tabs/Tab'; import { getStreams } from '../../../util/workflows'; import { Code } from '../../Code'; +import { ShardLink } from '../../links/ShardLink'; interface RouteParams { clusterID: string; @@ -46,6 +47,11 @@ export const Workflow = () => { const { data } = useWorkflow({ clusterID, keyspace, name }); const streams = getStreams(data); + let isReshard = false; + if (data && data.workflow) { + isReshard = data.workflow.workflow_type === 'Reshard'; + } + return (
@@ -54,6 +60,32 @@ export const Workflow = () => { {name} + {isReshard && ( +
+
+ + {data?.workflow?.source?.shards?.length! > 1 ? 'Source Shards: ' : 'Source Shard: '} + {data?.workflow?.source?.shards?.map((shard) => ( + + + {`${keyspace}/${shard} `} + + + ))} + + + {data?.workflow?.target?.shards?.length! > 1 ? 'Target Shards: ' : 'Target Shard: '} + {data?.workflow?.target?.shards?.map((shard) => ( + + + {`${keyspace}/${shard} `} + + + ))} + +
+
+ )}
diff --git a/web/vtadmin/src/components/routes/workflow/WorkflowDetails.tsx b/web/vtadmin/src/components/routes/workflow/WorkflowDetails.tsx index 54c473c9432..331d356ca23 100644 --- a/web/vtadmin/src/components/routes/workflow/WorkflowDetails.tsx +++ b/web/vtadmin/src/components/routes/workflow/WorkflowDetails.tsx @@ -25,6 +25,7 @@ import { formatStreamKey, getReverseWorkflow, getStreamSource, + getStreamTarget, getStreams, getTableCopyStates, } from '../../../util/workflows'; @@ -34,6 +35,9 @@ import { DataCell } from '../../dataTable/DataCell'; import { StreamStatePip } from '../../pips/StreamStatePip'; import { ThrottleThresholdSeconds } from '../Workflows'; import { ShardLink } from '../../links/ShardLink'; +import { Tooltip } from '../../tooltip/Tooltip'; +import { TabletLink } from '../../links/TabletLink'; +import { formatAlias } from '../../../util/tablets'; interface Props { clusterID: string; @@ -47,7 +51,7 @@ const LOG_COLUMNS = ['Type', 'State', 'Updated At', 'Message', 'Count']; const TABLE_COPY_STATE_COLUMNS = ['Table Name', 'Total Bytes', 'Bytes Copied', 'Total Rows', 'Rows Copied']; -const STREAM_COLUMNS = ['Stream', 'State', 'Message', 'Transaction Timestamp', 'Database Name']; +const STREAM_COLUMNS = ['Stream', 'Source Shard', 'Target Shard', 'Message', 'Transaction Timestamp', 'Database Name']; export const WorkflowDetails = ({ clusterID, keyspace, name }: Props) => { const { data: workflowData } = useWorkflow({ clusterID, keyspace, name }); @@ -148,6 +152,7 @@ export const WorkflowDetails = ({ clusterID, keyspace, name }: Props) => { const renderStreamRows = (rows: typeof streams) => { return rows.map((row) => { const source = getStreamSource(row); + const target = getStreamTarget(row, keyspace); const href = row.tablet && row.id ? `/workflow/${clusterID}/${keyspace}/${name}/stream/${row.tablet.cell}/${row.tablet.uid}/${row.id}` @@ -159,22 +164,20 @@ export const WorkflowDetails = ({ clusterID, keyspace, name }: Props) => { return ( - {' '} + + + {' '} + + {row.key} - {source && ( -
- Source Shard{' '} - - {source} - -
- )} +
+ Tablet{' '} + + {formatAlias(row.tablet)} + +
Updated {formatDateTimeShort(row.time_updated?.seconds)}
@@ -185,7 +188,28 @@ export const WorkflowDetails = ({ clusterID, keyspace, name }: Props) => {
) : null} - {rowState} + + {source ? ( + + {source} + + ) : ( + '-' + )} + + + {target ? ( + + {target} + + ) : ( + '-' + )} + {row.message ? row.message : '-'} {row.transaction_timestamp && row.transaction_timestamp.seconds @@ -239,7 +263,7 @@ export const WorkflowDetails = ({ clusterID, keyspace, name }: Props) => { }; return ( -
+
{ pageSize={1} title="Summary" /> + { )} - -

- Streams -

- {/* TODO(doeg): add a protobuf enum for this (https://github.com/vitessio/vitess/projects/12#card-60190340) */} - {['Error', 'Copying', 'Running', 'Stopped'].map((streamState) => { - if (!Array.isArray(streamsByState[streamState])) { - return null; - } - - return ( -
- -
- ); - })}
); };