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

Add shutdown state in vtgate #14088

Closed

Conversation

davidpiegza
Copy link
Contributor

Description

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on the CI
  • Documentation was added or is not required

Deployment Notes

Tom Krouper and others added 30 commits November 2, 2020 11:48
vitess release 2021-04-01
* Flatten savepoint statements.

Signed-off-by: Arthur Schreiber <[email protected]>

* Avoid sending savepoint events unless required.

Signed-off-by: Arthur Schreiber <[email protected]>
vstreamer: flatten savepoint events (vitessio#9892)
Revert "vstreamer: flatten savepoint events (vitessio#9892)"
Fetch from upstream 2022-29-04
Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
* docs: added to the release notes

Signed-off-by: Andres Taylor <[email protected]>

* Add name to static check workflow

Signed-off-by: Rohit Nayak <[email protected]>

Co-authored-by: Rohit Nayak <[email protected]>
…0453) (vitessio#10466)

* fix: change planner_version to planner-version everywhere

Signed-off-by: Andres Taylor <[email protected]>

* fix: actually change the planner version on vtgate after checking

Signed-off-by: Andres Taylor <[email protected]>

* fix: move CheckPlannerVersionFlag out from vtgate

Signed-off-by: Andres Taylor <[email protected]>

* fix: move the global plannerVersion to be a field on the executor. think global, act local, yo

Signed-off-by: Andres Taylor <[email protected]>

* fix: use the planner in the session first

Signed-off-by: Andres Taylor <[email protected]>

* test: use DEFAULT instead of 0

Signed-off-by: Andres Taylor <[email protected]>

* fix: re-add the planner-version flag to vtcombo

Signed-off-by: Andres Taylor <[email protected]>
* Add PingTablet to mock vtctld

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for PingTablet

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for RefreshState

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for RefreshTabletReplicationSource

Signed-off-by: Andrew Mason <[email protected]>

* Add RunHealthCheck to mock vtctld

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for RunHealthCheck

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for SetReadOnly

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for SetReadWrite

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for StartReplication

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for StopReplication

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for TabletExternallyPromoted

Signed-off-by: Andrew Mason <[email protected]>
* add sharding column name/type deprecation to release notes summary

Signed-off-by: deepthi <[email protected]>

* deprecation: mark sharding-column-name and sharding-column-type for CreateKeyspace command as deprecated

Signed-off-by: deepthi <[email protected]>
* [vtadmin] Add authz tests for remaining non-schema related actions (vitessio#10481)

* Add authz tests for EmergencyFailoverShard

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for PlannedFailoverShard

Signed-off-by: Andrew Mason <[email protected]>

* Add ValidateKeyspace to mock vtctld

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for ValidateKeyspace

Signed-off-by: Andrew Mason <[email protected]>

* Add ValidateSchemaKeyspace to mock vtctld

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for ValidateSchemaKeyspace

Signed-off-by: Andrew Mason <[email protected]>

* Add ValidateVersionKeyspace to mock vtctld

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for ValidateVersionKeyspace

Signed-off-by: Andrew Mason <[email protected]>

* fixup mock data sorting

Signed-off-by: Andrew Mason <[email protected]>

* [vtadmin] Add schema-related authz tests (vitessio#10486)

* Update template to support more tablet fields

Signed-off-by: Andrew Mason <[email protected]>

* Update template, add full srvvschema payload, add schema payload, add authz tests for VTExplain

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for GetSchema

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for GetSchemas

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for FindSchema

Signed-off-by: Andrew Mason <[email protected]>

* Add authz tests for ReloadSchemas

Signed-off-by: Andrew Mason <[email protected]>
…io#10502) (vitessio#10509)

* Update docs for backup commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for cell commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for keyspace commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for legacy-shim command

Signed-off-by: Andrew Mason <[email protected]>

* Update docs, add aliases for reparent commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for root command

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for routing rule commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for schema commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for serving graph commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for shard commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for tablet commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for vschema commands

Signed-off-by: Andrew Mason <[email protected]>

* Update docs for workflow commands

Signed-off-by: Andrew Mason <[email protected]>

* Remove references to deprecated flags

Signed-off-by: Andrew Mason <[email protected]>

* fixup! Update docs for keyspace commands

Signed-off-by: Andrew Mason <[email protected]>

* Remove reparent command aliases

Signed-off-by: Andrew Mason <[email protected]>

* Specify that `--server` is required

Signed-off-by: Andrew Mason <[email protected]>
… and move it to places which will only be called less frequently (vitessio#10516) (vitessio#10518)

Signed-off-by: Manan Gupta <[email protected]>
… and vitessio#10514 (vitessio#10517)

* Fix parsing of CAST() statements (vitessio#10512)

* Fix parsing of CAST() statements

CAST() was treated as an alias for CONVERT() but with slightly different
syntax.

This is also described in the documentation at
https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html,
specifically:

With CAST(expr AS type syntax, the CAST() function takes an expression of
any type and produces a result value of the specified type. This operation
may also be expressed as CONVERT(expr, type), which is equivalent. If expr
is NULL, CAST() returns NULL.

This is wrong sadly. CAST() is not equivalent to CONVERT(), specifically
in the context of a CREATE TABLE. For JSON keys, the ARRAY attribute is
possible on a CAST(), but that is not accepted for a CONVERT().

The difference in parsing also shows in MySQL:

```
mysql> select convert(json_keys(c), char(64) array) from t;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'array) from t' at line 1
mysql> select cast(json_keys(c) as char(64) array) from t;
ERROR 1235 (42000): This version of MySQL doesn't yet support 'Use of CAST( .. AS .. ARRAY) outside of functional index in CREATE(non-SELECT)/ALTER TABLE or in general expressions'
```

Here the first statement can't be parsed at all. The second is properly
parsed, but ARRAY is not allowed in the context of CAST() in this
situation (and only in a CREATE TABLE).

This means we should really treat these as two separate expressions and
don't store them both in the same structure. The change here creates a
separate CAST structure, removes the ARRAY option from CONVERT and
updates the grammar and all tests accordingly.

Signed-off-by: Dirkjan Bussink <[email protected]>

* Handle new cast expression in evalengine and planbuilder

Signed-off-by: Dirkjan Bussink <[email protected]>

* evalengine: do not duplicate CAST/CONVERT translation

Signed-off-by: Vicent Marti <[email protected]>

Co-authored-by: Vicent Marti <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>

* Add back unary single column expression check (vitessio#10514)

This was accidentally removed in
vitessio#10512 but it shouldn't have
been.

Signed-off-by: Dirkjan Bussink <[email protected]>

Co-authored-by: Dirkjan Bussink <[email protected]>
Co-authored-by: Vicent Marti <[email protected]>
…#10508) (vitessio#10528)

* addition of the release_notes_label workflow

Signed-off-by: Florent Poinsard <[email protected]>

* addition of a helper step in the release_notes_label to guide users

Signed-off-by: Florent Poinsard <[email protected]>

* addition of a set of rules for release_notes_labels's pull_request target

Signed-off-by: Florent Poinsard <[email protected]>

* remove the previous workflow that used to check the release notes labels

Signed-off-by: Florent Poinsard <[email protected]>

* Change the review check list and enforce the use of type/component labels

Signed-off-by: Florent Poinsard <[email protected]>

* Fixed syntax in check release notes label workflow

Signed-off-by: Florent Poinsard <[email protected]>
…#10532)

* generate the release changelog as a second document

Signed-off-by: Florent Poinsard <[email protected]>

* include every PR in the release notes

Signed-off-by: Florent Poinsard <[email protected]>

* Moved changelog metrics away from the changelog and added summary for v15

Signed-off-by: Florent Poinsard <[email protected]>
…0553)

* test: added failing e2e test

Signed-off-by: Harshit Gangal <[email protected]>

* fix: handle empty row for scalar aggregation and also olap engine for scalar aggregation

Signed-off-by: Harshit Gangal <[email protected]>

* test: update plan test output

Signed-off-by: Harshit Gangal <[email protected]>

* test: e2e test for empty rows in non-scalar aggregates

Signed-off-by: Harshit Gangal <[email protected]>

Co-authored-by: Florent Poinsard <[email protected]>

Co-authored-by: Florent Poinsard <[email protected]>
* docs: add blurb about gen4 being the new planner

Signed-off-by: Andres Taylor <[email protected]>

* docs: release notes

Signed-off-by: Andres Taylor <[email protected]>
…itessio#10464) (vitessio#10546)

* Adds RPCs to vttablet that vtorc requires (vitessio#10464)

* feat: add vttablet rpc to reset replication parameters

Signed-off-by: Manan Gupta <[email protected]>

* feat: added end to end testing for the rpc and fixed bug

Signed-off-by: Manan Gupta <[email protected]>

* feat: fix typing error

Signed-off-by: Manan Gupta <[email protected]>

* feat: add basic full status rpc functionality and add test for it

Signed-off-by: Manan Gupta <[email protected]>

* feat: add all the fields needed in full status

Signed-off-by: Manan Gupta <[email protected]>

* test: moved the test to reparent tests and improved it

Signed-off-by: Manan Gupta <[email protected]>

* feat: bug fix for no replication status and no primary status

Signed-off-by: Manan Gupta <[email protected]>

* feat: add version to the full status output

Signed-off-by: Manan Gupta <[email protected]>

* feat: add binlog information to full status

Signed-off-by: Manan Gupta <[email protected]>

* docs: fix the comment explaining the binlog information

Signed-off-by: Manan Gupta <[email protected]>

* feat: add semi-sync statuses to full status

Signed-off-by: Manan Gupta <[email protected]>

* feat: call the correct command

Signed-off-by: Manan Gupta <[email protected]>

* feat: add server uuid and id to full status

Signed-off-by: Manan Gupta <[email protected]>

* feat: make server_id a uint32 to accept the correct range of values

Signed-off-by: Manan Gupta <[email protected]>

* feat: add few more fields to the full status like version comment, semi-sync settings, binlog_row_image

Signed-off-by: Manan Gupta <[email protected]>

* feat: generate vtadmin proto files

Signed-off-by: Manan Gupta <[email protected]>

* test: add assertion to check binlog row format is read correctly

Signed-off-by: Manan Gupta <[email protected]>

* feat: split GTID mode in its own function because mariadb doesn't support it

Signed-off-by: Manan Gupta <[email protected]>

* feat: fix parsing of empty mariadb gtid set

Signed-off-by: Manan Gupta <[email protected]>

* docs: add doucmentation for existing fields in ReplicationStatus

Signed-off-by: Manan Gupta <[email protected]>

* feat: add relay log file position to the replication status output

Signed-off-by: Manan Gupta <[email protected]>

* test: augmented full status test to check all the different positions stored

Signed-off-by: Manan Gupta <[email protected]>

* feat: add additional fields to replication status and read source user

Signed-off-by: Manan Gupta <[email protected]>

* feat: read sql delay from show replica status output

Signed-off-by: Manan Gupta <[email protected]>

* feat: read ssl allowed from show replica status output

Signed-off-by: Manan Gupta <[email protected]>

* feat: read has replication filters from show replica status output

Signed-off-by: Manan Gupta <[email protected]>

* feat: read auto position and using gtid from show replica status output

Signed-off-by: Manan Gupta <[email protected]>

* feat: add replication lag unknown too to replication status

Signed-off-by: Manan Gupta <[email protected]>

* feat: return nils from replication and primary postiion if it is not present

Signed-off-by: Manan Gupta <[email protected]>

* feat: rename FileRelayLogPosition in replication status output to RelayLogSourceBinLogEquivalentPosition and augment test to make sure rpc changes are backward compatible

Signed-off-by: Manan Gupta <[email protected]>

* feat: update vtadmin proto files

Signed-off-by: Manan Gupta <[email protected]>

* refactor: rename BinLog to binlog in renamed proto field

Signed-off-by: Manan Gupta <[email protected]>

* lint: add a new line to proto file

Signed-off-by: Manan Gupta <[email protected]>
frouioui and others added 24 commits March 21, 2023 15:28
…le (vitessio#12607) (vitessio#12647)

* [gen4 planner] Make sure to not push down expressions when not possible (vitessio#12607)

* Fix random aggregation to not select Null column
* stop pushing down projections that should be evaluated at the vtgate level
* undo changes to AggregateRandom
* clean up code
* fix executor test mock

Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>

* Fix schema error

Signed-off-by: Florent Poinsard <[email protected]>

---------

Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Co-authored-by: Andres Taylor <[email protected]>
…tessio#12534) (vitessio#12692)

* feat: fix initialization code to also stop replication



* feat: fix tests expectations



* feat: fix wrangler tests



---------

Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
…#12699)

* [planner bugfix] add expressions to HAVING

When a predicate contains aggregation, it should not
be added to the WHERE clause. It should go to the



* update test expecteations



---------

Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Andres Taylor <[email protected]>
…ssio#12708)

* Auto upgrade the Golang version (vitessio#12585)

* initial addition of the go_upgrade tool to detect and bump the golang version

Signed-off-by: Florent Poinsard <[email protected]>

* update go.mod automatically

Signed-off-by: Florent Poinsard <[email protected]>

* fix isSameMajor version issue

Signed-off-by: Florent Poinsard <[email protected]>

* update the bootstrap version automatically

Signed-off-by: Florent Poinsard <[email protected]>

* update the bootstrap docker image changelog

Signed-off-by: Florent Poinsard <[email protected]>

* uncomment code

Signed-off-by: Florent Poinsard <[email protected]>

* addition of workflow

Signed-off-by: Florent Poinsard <[email protected]>

* addition of base to create-pull-request

Signed-off-by: Florent Poinsard <[email protected]>

* test create PR alternative

Signed-off-by: Florent Poinsard <[email protected]>

* add flags and getter methods

Signed-off-by: Florent Poinsard <[email protected]>

* better PR message

Signed-off-by: Florent Poinsard <[email protected]>

* fix no-workflow-update flag and better PR body msg

Signed-off-by: Florent Poinsard <[email protected]>

* fix PR title, branch and body format

Signed-off-by: Florent Poinsard <[email protected]>

* test matrix and pwd path

Signed-off-by: Florent Poinsard <[email protected]>

* enhanced matrix

Signed-off-by: Florent Poinsard <[email protected]>

* update_workflows option

Signed-off-by: Florent Poinsard <[email protected]>

* update workflows independently

Signed-off-by: Florent Poinsard <[email protected]>

* test without matrix

Signed-off-by: Florent Poinsard <[email protected]>

* Add docs to go_upgrade and re-add matrix to the workflow

Signed-off-by: Florent Poinsard <[email protected]>

* support major version upgrade

Signed-off-by: Florent Poinsard <[email protected]>

* do not update bootstrap version if they are the same

Signed-off-by: Florent Poinsard <[email protected]>

* migrate to cobra instead of pflags

Signed-off-by: Florent Poinsard <[email protected]>

* remove redundant comment

Signed-off-by: Florent Poinsard <[email protected]>

* safety net around replaceGoVersionInCodebase to avoid unrequired upgrade

Signed-off-by: Florent Poinsard <[email protected]>

* Remove double negation in workflowUpdate flag

Signed-off-by: Florent Poinsard <[email protected]>

* Use regexp instead of mere string comparison

Signed-off-by: Florent Poinsard <[email protected]>

* Proper regexp for every string comparison

Signed-off-by: Florent Poinsard <[email protected]>

* use better regex

Signed-off-by: Florent Poinsard <[email protected]>

* remove useless flag and improve the auto-PR body description

Signed-off-by: Florent Poinsard <[email protected]>

* add note in the tool usage to run the tool at the root of the repo

Signed-off-by: Florent Poinsard <[email protected]>

* add comment in .github/workflows/update_golang_version.yml

Signed-off-by: Florent Poinsard <[email protected]>

* Apply @mattlord code suggestion

Signed-off-by: Florent Poinsard <[email protected]>

* replace usages of old filename

Signed-off-by: Florent Poinsard <[email protected]>

* Apply suggestions from code review

Co-authored-by: Matt Lord <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>

---------

Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Matt Lord <[email protected]>

* Fix regexp

Signed-off-by: Florent Poinsard <[email protected]>

* remove the use of DateOnly

Signed-off-by: Florent Poinsard <[email protected]>

---------

Signed-off-by: Florent Poinsard <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Matt Lord <[email protected]>
…er timeout (vitessio#12114) (vitessio#12302)

* Retry error if it happens after timeout

Signed-off-by: Rohit Nayak <[email protected]>

* Address review comments

Signed-off-by: Rohit Nayak <[email protected]>

* Address review comments

Signed-off-by: Rohit Nayak <[email protected]>

* Improve unit tests

Signed-off-by: Rohit Nayak <[email protected]>

---------

Signed-off-by: Rohit Nayak <[email protected]>
Co-authored-by: Rohit Nayak <[email protected]>
Signed-off-by: Hormoz Kheradmand <[email protected]>
Co-authored-by: Hormoz Kheradmand <[email protected]>
…ce=innodb_system are included in the schema (vitessio#12672) (vitessio#12734)

* Use a left join to make sure that tables with tablespace=innodb_system are not skipped when loading the schema (fixes vitessio#12669)

Signed-off-by: Oleksiy Kovyrin <[email protected]>

* Set tablespace on a test table to see if it breaks vstreamer

Signed-off-by: Oleksiy Kovyrin <[email protected]>

---------

Signed-off-by: Oleksiy Kovyrin <[email protected]>
Co-authored-by: Oleksiy Kovyrin <[email protected]>
…sio#12683) (vitessio#12744)

* Reset the current lag when closing the replication lag reader.



* Fix tests.



---------

Signed-off-by: Johan Stenberg <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Johan Stenberg <[email protected]>
…itessio#12747)

Signed-off-by: Hormoz Kheradmand <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Hormoz Kheradmand <[email protected]>
* Release notes for 15.0.3

Signed-off-by: Matt Lord <[email protected]>

* Release commit for 15.0.3

Signed-off-by: Matt Lord <[email protected]>

* Rename directory

Signed-off-by: Matt Lord <[email protected]>

* Update changelog/15.0/15.0.3/release_notes.md

Signed-off-by: Florent Poinsard <[email protected]>

---------

Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Florent Poinsard <[email protected]>
Co-authored-by: Florent Poinsard <[email protected]>
…itessio#11313)

Add a VIndex option to skip verify-after-insert behavior when using INSERT...IGNORE or INSERT...ON DUPLICATE KEY UPDATE.

Co-authored-by: Harshit Gangal <[email protected]>
Co-authored-by: Jacques Grove <[email protected]>

Signed-off-by: Max Englander <[email protected]>

Signed-off-by: Max Englander <[email protected]>
DML to lookup VIndexes unconditionally takes a row lock on rows in the
lookup VIndex backing table. Add an option to optionally elide this lock
for cases where we know via business logic that the row will not be
deleted, nor the lookup column changed.

Signed-off-by: Max Englander <[email protected]>

Signed-off-by: Max Englander <[email protected]>
Backport `read_lock` and `no_verify` VIndex options
Signed-off-by: Patrick Carnahan <[email protected]>
Add support for new lock syntax in MySQL8
@vitess-bot
Copy link
Contributor

vitess-bot bot commented Sep 25, 2023

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 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 Sep 25, 2023
@github-actions github-actions bot added this to the v18.0.0 milestone Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.