vitess icon indicating copy to clipboard operation
vitess copied to clipboard

ApplySchema: deprecate '--skip_preflight' flag

Open shlomi-noach opened this issue 1 year ago • 5 comments

Description

This PR deprecates the flag --skip_preflight in vtctlclient ApplySchema. The new behavior is as if --skip_preflight=true. That is, to always skip preflight. In fact, the preflight code is completely removed in this PR.

The Vitess team discussed deprecating --skip_preflight a long time ago, with the advent of Online DDL. Moreover, we have noticed that in production environments we always set the flag. And furthermore, the logic used by --skip_preflight is not on par with new schema change logic: Online DDL and schemadiff, and we've encountered scenarios where the logic was flawed.

As Vitess now recommends running migrations via Online DDL, we should move away from preflight checks.

Related Issue(s)

#6926

Checklist

  • [ ] "Backport me!" label has been added if this change should be backported
  • [ ] Tests were added or are not required
  • [ ] Documentation was added or is not required

Deployment Notes

shlomi-noach avatar Jul 17 '22 16:07 shlomi-noach

Review Checklist

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

General

  • [ ] Ensure that the Pull Request has a descriptive title.
  • [ ] If this is a change that users need to know about, please apply the release notes (needs details) label so that merging is blocked unless the summary release notes document is included.
  • [ ] If a test is added or modified, there should be a documentation on top of the test to explain what the expected behavior is what the test does.

If a new flag is being introduced:

  • [ ] Is it really necessary to add this flag?
  • [ ] Flag names should be clear and intuitive (as far as possible)
  • [ ] Help text should be descriptive.
  • [ ] Flag names should use dashes (-) as word separators rather than underscores (_).

If a workflow is added or modified:

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

Bug fixes

  • [ ] There should be at least one unit or end-to-end test.
  • [ ] The Pull Request description should include a link to an issue that describes the bug.

Non-trivial changes

  • [ ] There should be some code comments as to why things are implemented the way they are.

New/Existing features

  • [ ] Should be documented, either by modifying the existing documentation or creating new documentation.
  • [ ] New features should have a link to a feature request issue or an RFC that documents the use cases, corner cases and test cases.

Backward compatibility

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

vitess-bot[bot] avatar Jul 17 '22 16:07 vitess-bot[bot]

I feel that deprecating the flag would be setting the default to true and adding a deprecation warning in the CLI and docs while removal would be removing the code done here along the the preflight tablet manager client code. The PR seems to be in the middle. Do we need to do a deprecation cycle? What's the value of keeping the flag if you can't set it?

Please keep in mind that I am glad we're getting rid of this and appreciate you working on that. 🙂

mattlord avatar Jul 17 '22 17:07 mattlord

Do we need to do a deprecation cycle? What's the value of keeping the flag if you can't set it?

@mattlord we have to have a deprecation cycle. So in v15 the user should get a warning (you're right! I did not add a warning log -- will fix), and in v16 we can remove the flag altogether.

You're also right that the easiest way forward would be to just take care of the flag, force it to true, then keep the rest of internal logic. However, we're doing some refactoring in tablet_executor.go to reduce footprint, and this would help in simplifying these efforts as it would remove some bulk of code.


UPDATE v16 is already released, so this work applies to v17 & v18.

shlomi-noach avatar Jul 20 '22 14:07 shlomi-noach

Added deprecation warning

shlomi-noach avatar Jul 25 '22 06:07 shlomi-noach

Cluster (vtgate_schema) seems to be consistently failing. Unsure yet how this PR affects it -- but it looks like it does.

shlomi-noach avatar Aug 02 '22 04:08 shlomi-noach

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

github-actions[bot] avatar Sep 16 '22 01:09 github-actions[bot]

This is not stale. I'm just stuck. Can't solve the CI issue.

shlomi-noach avatar Sep 18 '22 05:09 shlomi-noach

Still stuck here.

shlomi-noach avatar Oct 13 '22 06:10 shlomi-noach

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

github-actions[bot] avatar Dec 13 '22 01:12 github-actions[bot]

This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:

  • Push additional commits to the associated branch.
  • Remove the stale label.
  • Add a comment indicating why it is not stale.

If no action is taken within 7 days, this PR will be closed.

github-actions[bot] avatar Jan 13 '23 01:01 github-actions[bot]

This PR was closed because it has been stale for 7 days with no activity.

github-actions[bot] avatar Jan 21 '23 01:01 github-actions[bot]

Fashionably late, this PR is ready for review!

shlomi-noach avatar Feb 27 '23 08:02 shlomi-noach

Current error in Upgrade Downgrade Testing Query Serving (Schema):

2023-02-27T15:36:44.2867788Z ERROR: Go version reported: go version go1.19.4 linux/amd64. Version 1.20.1+ required. See https://vitess.io/contributing/build-from-source for install instructions.
2023-02-27T15:36:44.2873075Z ##[error]Process completed with exit code 1.

shlomi-noach avatar Feb 27 '23 16:02 shlomi-noach

Upgrade Downgrade Testing Query Serving (Schema) failure is a known issue to be fixed imminently; meanwhile merging this PR.

shlomi-noach avatar Feb 28 '23 07:02 shlomi-noach