Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

beingnoble03
Copy link
Member

@beingnoble03 beingnoble03 commented Nov 4, 2024

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

Screenshot 2024-11-04 at 7 56 55 PM Screenshot 2024-11-08 at 3 25 40 PM

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

Copy link
Contributor

vitess-bot bot commented Nov 4, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Nov 4, 2024
@github-actions github-actions bot added this to the v22.0.0 milestone Nov 4, 2024
@beingnoble03 beingnoble03 added Type: Enhancement Logical improvement (somewhere between a bug and feature) Component: VTAdmin VTadmin interface and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Nov 4, 2024
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 43.33333% with 17 lines in your changes missing coverage. Please review.

Project coverage is 67.33%. Comparing base (1a4f2b9) to head (2875bd7).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
go/vt/vtadmin/http/schema_migrations.go 0.00% 11 Missing ⚠️
go/vt/vtadmin/api.go 68.42% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17134      +/-   ##
==========================================
- Coverage   67.44%   67.33%   -0.12%     
==========================================
  Files        1571     1569       -2     
  Lines      252197   252502     +305     
==========================================
- Hits       170103   170018      -85     
- Misses      82094    82484     +390     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rohit-nayak-ps
Copy link
Contributor

This UI is only for the vitess ddl strategy. So we don't need that option while creating.

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.

@shlomi-noach
Copy link
Contributor

Hey there! A few comments:

  • DDL strategy can include DDL strategy flags. So for example it could look like vitess --postpone-completion --singleton-context --cut-over-threshold=15s. In light of that, let leave it editable. But then, it also requires quite a length box. I'd say keyspace has too much space, and DDL strategy too little.
  • It is possible to submit a migration with direct DDL strategy -- but then it won't show in the schema migrations page.
  • However, the strategy mysql is a hybrid of the two - and will show in the schema migrations page.

So yes, let's allow free text in the DDL strategy flag.

@beingnoble03
Copy link
Member Author

As discussed, I've removed the ddl-strategy text box, to allow only vitess ddl strategy. We can add the advanced options in a follow-up PR?

@shlomi-noach
Copy link
Contributor

As discussed, I've removed the ddl-strategy text box, to allow only vitess ddl strategy.

This looks to be a misunderstanding, in #17134 (comment) I indicated that we should keep it after all?

@rohit-nayak-ps
Copy link
Contributor

As discussed, I've removed the ddl-strategy text box, to allow only vitess ddl strategy.

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.

@shlomi-noach
Copy link
Contributor

@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.

@beingnoble03
Copy link
Member Author

@rohit-nayak-ps @shlomi-noach done, also increased the size of the box as mentioned.

@rohit-nayak-ps
Copy link
Contributor

  • On creating a new migration, it goes to the Migrations screen but without choosing a keyspace, so it shows up empty and is confusing. Also on refreshing it goes back to the empty screen because it doesn't remember the chosen keyspace.

  • We should also have a details page for each migration with more details including the actual sql query.

  • i created a migration in a sharded keyspace and it only shows one of the shards in the detail.

  • Also I think we should change the default strategy to vitess: since that is how we expect most users to run migrations. Remove gh-ost (already unsupported) and pt-osc (slated to be removed soon): https://vitess.io/docs/22.0/user-guides/schema-changes/ddl-strategies/.

  • Regarding UI: can we align the timestamps so that it is easier to compare.

@beingnoble03
Copy link
Member Author

beingnoble03 commented Nov 13, 2024

  • On creating a new migration, it goes to the Migrations screen but without choosing a keyspace, so it shows up empty and is confusing. Also on refreshing it goes back to the empty screen because it doesn't remember the chosen keyspace.

Fixed.

  • We should also have a details page for each migration with more details including the actual sql query.

Can this be done in follow-up PRs?

  • i created a migration in a sharded keyspace and it only shows one of the shards in the detail.
Screenshot 2024-11-13 at 10 52 42 PM

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 GetSchemaMigrations (different objs for different shards). Please let me know if we can to club this together in UI, we can do this in a follow-up PR.

Done.

  • Regarding UI: can we align the timestamps so that it is easier to compare.

Done.

Copy link
Contributor

@rohit-nayak-ps rohit-nayak-ps left a 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

@rohit-nayak-ps rohit-nayak-ps requested review from notfelineit and removed request for notfelineit November 19, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: VTAdmin VTadmin interface Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants