-
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: Support for schema migrations view/create #17134
VTAdmin: Support for schema migrations view/create #17134
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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17134 +/- ##
==========================================
+ Coverage 67.39% 67.41% +0.02%
==========================================
Files 1570 1574 +4
Lines 252892 253247 +355
==========================================
+ Hits 170437 170734 +297
- Misses 82455 82513 +58 ☔ View full report in Codecov by Sentry. |
cdbf4bc
to
f27341a
Compare
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
f27341a
to
ddc420a
Compare
This UI is only for the I will let @shlomi-noach comment on the UI requirements for a first cut. We will also need a detail screen from the list view. |
Hey there! A few comments:
So yes, let's allow free text in the DDL strategy flag. |
As discussed, I've removed the |
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
This looks to be a misunderstanding, in #17134 (comment) I indicated that we should keep it after all? |
My bad. The plan was to create an initial PR with defaults and then add UI for the strategy options. But maybe we should just add the text box to start with, so that we do support everything and then replace them with the UI later. @beingnoble03, can you please reinstate the text box, sorry for the confusion. |
@rohit-nayak-ps no problem, feel free to lead the way. I'll set some time next week to think about what we discussed over zoom, and how the UI can take shape in the next iteration. |
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
@rohit-nayak-ps @shlomi-noach done, also increased the size of the box as mentioned. |
|
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
Fixed.
Can this be done in follow-up PRs?
This is how it shows migrations for resharded keyspace. It shows different entries for different shards, even for the same migration. This is the format we get from
Done.
Done. |
Signed-off-by: Noble Mittal <noblemittal@outlook.com>
7ad0af7
to
fefdb5d
Compare
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.
Nice. Let's should do the following in a followup:
- Show a single line for each migration, keyed with UUID. That line can show just the shards involved and a consolidated status (similar to how we show a combined Workflow status for all streams)
- Add a details page where all the shards involved along with more info like the actual query itself is shown
|
||
const history = useHistory(); | ||
|
||
const [formData, setFormData] = useState<FormData>(DEFAULT_FORM_DATA); |
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 implementation of the form fields will cause the entire page to rerender whenever a parameter of formData
changes, since below, we set formData
to a brand new object each time.
Would prefer using flat state vars or simply using the HTML form data in a submission - however this is a nonblocking comment as you/we can refactor in a separate PR! 😄
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.
👍 I think this makes more sense to be done in a separate PR, as there are other components using the same structure.
import { vtctldata } from '../proto/vtadmin'; | ||
|
||
/** | ||
* SCEMA_MIGRATION_STATUS maps numeric schema migration status back to human readable strings. |
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.
* SCEMA_MIGRATION_STATUS maps numeric schema migration status back to human readable strings. | |
* SCHEMA_MIGRATION_STATUS maps numeric schema migration status back to human readable strings. |
/** | ||
* SCEMA_MIGRATION_STATUS maps numeric schema migration status back to human readable strings. | ||
*/ | ||
export const SCEMA_MIGRATION_STATUS = Object.entries(invertBy(vtctldata.SchemaMigration.Status)).reduce( |
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.
export const SCEMA_MIGRATION_STATUS = Object.entries(invertBy(vtctldata.SchemaMigration.Status)).reduce( | |
export const SCHEMA_MIGRATION_STATUS = Object.entries(invertBy(vtctldata.SchemaMigration.Status)).reduce( |
); | ||
|
||
export const formatSchemaMigrationStatus = (schemaMigration: vtctldata.ISchemaMigration) => | ||
schemaMigration.status && SCEMA_MIGRATION_STATUS[schemaMigration.status]; |
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.
schemaMigration.status && SCEMA_MIGRATION_STATUS[schemaMigration.status]; | |
schemaMigration.status && SCHEMA_MIGRATION_STATUS[schemaMigration.status]; |
Description
This PR adds a screen for schema migrations list for a particular keyspace, and a screen to create schema migration request. Also includes some related API changes.
Screenshots
Related Issue(s)
Checklist
Deployment Notes