-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VTAdmin: Add advanced workflow switchtraffic
options
#17658
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
switchtraffic
options
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17658 +/- ##
========================================
Coverage 67.76% 67.76%
========================================
Files 1585 1586 +1
Lines 255611 255745 +134
========================================
+ Hits 173217 173310 +93
- Misses 82394 82435 +41 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The only thing is that initializeTargetSequences isn't a boolean.
Beyond that, I tried to do various manual tests locally to confirm behavior. Do we not currently have any testing infrastructure in place to test the web UI? Something like Selenium, Puppeteer, Cypress, etc? The more we use VTAdmin for operations that can cause data loss and downtime, the more critical this testing becomes (in the past it was for the most part a read-only view of the cluster).
interface SwitchTrafficOptions { | ||
enableReverseReplication: boolean; | ||
force: boolean; | ||
initializeTargetSequences: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a boolean anymore after: #16860
@@ -328,7 +481,7 @@ const WorkflowActions: React.FC<WorkflowActionsProps> = ({ | |||
/> | |||
<WorkflowAction | |||
className="sm:max-w-xl" | |||
title="Complete MoveTables" | |||
title="Complete Workflow" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. We missed this when adding Reshard support. 🙂
@@ -12,8 +12,12 @@ import { | |||
} from '../../../hooks/api'; | |||
import Toggle from '../../toggle/Toggle'; | |||
import { success } from '../../Snackbar'; | |||
import { vtadmin, vtctldata } from '../../../proto/vtadmin'; | |||
import { vtadmin, vtctldata, vttime } from '../../../proto/vtadmin'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these linter warnings not valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are and we should address them! 😄
@@ -72,7 +72,7 @@ export const Tooltip = ({ children, text }: TooltipProps) => { | |||
}); | |||
|
|||
return ( | |||
<Popover content={content} isOpen={isOpen}> | |||
<Popover content={content} isOpen={isOpen} containerStyle={{ zIndex: '20' }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use tailwind styling here?
initializeTargetSequences: false, | ||
maxReplicationLagAllowed: 30, | ||
timeout: 30, | ||
tabletTypes: [1, 2, 3], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if we can use topodata.TabletType
s here instead of plain numbers 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 to that! Sorry, I meant to come back and comment on this but then forgot. We should use the existing consts:
topodatapb.TabletType_PRIMARY, topodatapb.TabletType_REPLICA, topodatapb.TabletType_RDONLY
const DefaultCancelWorkflowOptions: CancelWorkflowOptions = { | ||
keepData: false, | ||
keepRoutingRoules: false, | ||
}; | ||
|
||
const TABLET_OPTIONS = [1, 2, 3]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about using topodata.TabletType
s here too!
You can add some tests for this component like: https://github.com/vitessio/vitess/blob/main/web/vtadmin/src/components/ReadOnlyGate.test.tsx |
Description
This PR adds advanced workflow switch options in VTAdmin web. Also, a minor change:
Reshard
workflow can now be completed from VTAdmin itself.Screenshots
Related Issue(s)
Checklist
Deployment Notes