-
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
Examples: Add lib functions to wait for shard states #12239
Conversation
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
57dfbc7
to
3f4104e
Compare
245ce0b
to
03fd3c5
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
0c1955e
to
2b95544
Compare
Signed-off-by: Matt Lord <mattalord@gmail.com>
2b95544
to
eb7c7aa
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.
looks good to me apart from the outstanding comments.
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.
Great changes, thanks!
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Also address shellcheck warnings. Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
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 looking good to me! Thank you for doing this @mattlord, this is awesome work 🙌🏻
Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
I was unable to backport this Pull Request to the following branches: |
* Add lib functions to wait for shard states Signed-off-by: Matt Lord <mattalord@gmail.com> * Fixup region example too Signed-off-by: Matt Lord <mattalord@gmail.com> * Address minor review comments Signed-off-by: Matt Lord <mattalord@gmail.com> * Remove extraneous line change Signed-off-by: Matt Lord <mattalord@gmail.com> * Refactor to remove duplicated files/code Also address shellcheck warnings. Signed-off-by: Matt Lord <mattalord@gmail.com> * Fix tests that run in CI Signed-off-by: Matt Lord <mattalord@gmail.com> * Use more robust location detection Signed-off-by: Matt Lord <mattalord@gmail.com> * Fix backup tests Signed-off-by: Matt Lord <mattalord@gmail.com> * Exit on shard healthy failure Signed-off-by: Matt Lord <mattalord@gmail.com> * Remove unused dups and adjust client_test and Dockerfiles Signed-off-by: Matt Lord <mattalord@gmail.com> --------- Signed-off-by: Matt Lord <mattalord@gmail.com>
* Add lib functions to wait for shard states * Fixup region example too * Address minor review comments * Remove extraneous line change * Refactor to remove duplicated files/code Also address shellcheck warnings. * Fix tests that run in CI * Use more robust location detection * Fix backup tests * Exit on shard healthy failure * Remove unused dups and adjust client_test and Dockerfiles --------- Signed-off-by: Matt Lord <mattalord@gmail.com>
Description
Before modifying a shard we need to wait for the tablets to be up, a primary to be elected, and that primary to become healthy/serving. We were skipping this last check, but in practice it was virtually never an issue because the transition to primary after election (by
vtorc
now) was so fast. After #11520, however, once the primary has been elected it then needs to initialize its sidecar database. This additional time, while small, now makes the local examples unreliable because we do not wait for that to happen before we e.g. execute theApplySchema
vtctl client command. We also did not check for any errors in vtctl client commands like that, so you would not know anything was wrong until trying to execute a later step or command and you would see that e.g. the tables did not exist. In the process, I also made the following notable changes:Related Issue(s)
Checklist