Граф коммитов

374 Коммитов

Автор SHA1 Сообщение Дата
Rohit Nayak 8037f43d00
VStreamer: fix deadlock when there are a lot of vschema changes at the same time as binlog events (#11325)
* Don't block on vschema channel in case of heavy vschema changes and vstream load

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Prevent VStreamer engine deadlocks during state transitions

The VStreamer engine is somewhat unusual in two ways:
  1. It is open and running on replica tablets rather than only
     running on primary tablets.
  2. It has no controllers so the main engine mutex is widely shared.

Because of this, when a tablet has open vstreams (direct binary log
streams) performing work and a state transition starts, it can
deadlock with the tabletmanager's state lock when checking if
the engine is open or not.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Address review comments

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
2022-09-30 15:32:37 +02:00
Harshit Gangal b41af3cf49
Fix: DML engine multiequal support (#11395)
* fix: include MultiEqual in engine variant execution, added unit test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: added e2e test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-29 18:58:15 +05:30
Manan Gupta 90bb301de3
VTOrc cleanup: Remove unused CLI code and move relevant APIs to the new VTOrc UI (#11370)
* feat: remove cli code which isn't used in vtorc

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: port over the /api/problems endpoint to the http server of VTOrc

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: added comments to api/problems/ endpoint explaining the future scope

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove api endpoints registered in old VTOrc ui

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove gracefulTakeover tests since the api is removed and add tests for the api/problems API

Signed-off-by: Manan Gupta <manan@planetscale.com>

* refactor: fix license year and imports

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add apis for disabling and enabling global recoveries

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add api for reading replication-analysis

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add health api as well

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add tests for the api's ported over

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add liveness endpoint to tests too

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: return an internal server error when VTOrc isn't healthy

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: reduce flakiness in api tests

Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-28 09:42:37 -07:00
Matt Lord 2f717e8921
VStreams: Rotate Binary Log For Snapshot Connections (#11344)
* Rotate binary log before for snapshot connections

Rotate the binary logs to limit the GTID auto positioning overhead.
This is needed as the currently open binary log (which can be up to 1G in size
by default) will need to be scanned and empty GTID events will be streamed for
those GTIDs in the log that we are skipping. In total, this can add a lot of
overhead on both the mysqld instance and the tablet.
Rotating the log ensures that we are processing a fresh binary log that will
be minimal in size and GTID events.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Don't cause VStream failure if we can't rotate the binary log

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Limit binlog flushes and add e2e test

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Minor changes after self review

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add flag and Get/Set methods for the rotation threshold

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use dashes for new flags

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Minor changes after self review

Signed-off-by: Matt Lord <mattalord@gmail.com>

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-27 02:19:35 -04:00
Matt Lord 68b58a9e7f
Flakes: Fix Backup Transform Test Flakiness (#11352)
* Setup 2 healthy replicas, confirm semi-sync and repl state

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Cleanup after self review

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Reduce backup job time so that transform at least gets a chance to run

Signed-off-by: Matt Lord <mattalord@gmail.com>

* More reliably clear out tablet data

Signed-off-by: Matt Lord <mattalord@gmail.com>

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-27 02:07:17 -04:00
Rohit Nayak 86e0cf822b
Partial Movetables: allow moving a table one shard at a time (#9987)
* Initial Implementation of partial movetables.  Implement cross-shard queries that obey shard routing rules.

Refactor rss updation with routed shard and add to multi col resolution. Run vtgate and reservedconn tests for both regular and with a partially moved shard.

Add ability to run tests with partial keyspaces by adding to a list in the CI generator. Implement that in test.go and cluster setup. Revert previous iteration of running partial keyspace tests in parallel. One test is failing: TestSetSystemVarAutocommitWithConnError.

Add partial vtgate misc test

Add partial keyspace tests to vtgate transaction

Add vtgate queries partial keyspace tests

Review and fix skipped tests where applicable. Refactor to allow conditional skipping of tests for partial keyspaces only so that other tests work exactly as earlier without specifying the DbName, for example

Add move shards example

Cache routing tables and minor refactor. Move move_shards example

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Add lookup index to move shards example. Comment error logs while trying to delete from missing _vt.vdiff table

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Remove move shards demo example

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Add vtgate flag to enable shard routing. Update tests to get vtparams based on partial keyspace setting, so that global routing continues to be tested as earlier without DbName being specified

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

To create subsequent partial movetables workflows we should ignore previous partial movetables (now frozen)

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Remove vdiff2 deletes since they were failing unit tests etc

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Use vtgate flag to enable shard routing rules

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Fix incorrect test setup

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Expect modified frozen query

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

set vtgate param --enable_shard_routing in partial movetables test

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Fix failing tests

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Fix flags test

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Use VTParams helper for partial keyspace tests

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Specify vtParams.DBName for partial keyspace queries

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Self-review. Remove bypass caching.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Report partial SwitchTraffic results

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Try to address most of the upstream PR review comments

From: https://github.com/vitessio/vitess/pull/9987

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Enforce proper routing for partial migrations

Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Minor changes after self review

Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Account for local timezone in check for vdiff progress

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Update go version in workflows. Fix gofmt issue

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Fix failing CI tests

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Comment failing test for partial keyspaces

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Fix TestVtGateVtExplain by specifying dbname

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Fix leftover debug code

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Move partial keyspace tests to a single shard. Refactor test.go to use multiple config.json files

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Address review comments

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Address review comments

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Improve test skip comments

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* gofmt

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Fix failing tests

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Address review comments

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Try TestFunctionInDefault for partial keyspaces. Update skip comment.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Delete temporary log lines

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
2022-09-23 12:15:12 +02:00
Manan Gupta 33a23d5567
Replication Manager Improvements (#11194)
* feat: add flag to turn off replication manager

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add test for replication manager failing when the primary tablet's port changes

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: path repair replication to also handle the of case of IO error

Signed-off-by: Manan Gupta <manan@planetscale.com>

* ci: add new package to run in cluter 18

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: fix flags test expectation

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: new flags should use hyphens

Signed-off-by: Manan Gupta <manan@planetscale.com>

* docs: fix comments in replication manager

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: rewrite replication manager check conditions to be more readable

Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-12 15:06:26 +05:30
Andres Taylor 1fa1245b91
New explain format: VTEXPLAIN (#10556)
* feat: added query logging to safe session

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: added [explain format=vtexplain] parsing and AST

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: add planning of vtexplain queries

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: keep the logging even in the precense of autocommits

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: use table result instead of warnings, and move the logging to scattercon

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: log commit to vtexplain logger and added e2e test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* feat: vindex query to mark vindexExec in session

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: run only for gen4 planner

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* feat: vtexplain logs with bindvars replaces, and begin being counted with the real query

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: add ACTUALLY_RUN_QUERIES as a comment directive to vtexplain and block dml queries if not specified

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: make sure we add the actually_runs_queries directive to inserts we want to inspect

Signed-off-by: Andres Taylor <andres@planetscale.com>

* docs: added info to release notes

Signed-off-by: Andres Taylor <andres@planetscale.com>

* typo: fix error message

Signed-off-by: Andres Taylor <andres@planetscale.com>

* feat: ignore cases on comment directives

Signed-off-by: Andres Taylor <andres@planetscale.com>

* fix: CommentDirective now hides internals so that the lower casing of keys can be preserved everywhere

Signed-off-by: Andres Taylor <andres@planetscale.com>

* test: improve assertion

Signed-off-by: Andres Taylor <andres@planetscale.com>

* chore: clean up accidental change

Signed-off-by: Andres Taylor <andres@planetscale.com>

* refactor: clean up so more responsibility for vtexplain ends up in the engine primitive

Signed-off-by: Andres Taylor <andres@planetscale.com>

* fix: no need to Unquote multiple times

Signed-off-by: Andres Taylor <andres@planetscale.com>

* fix: rename comment directive

Signed-off-by: Andres Taylor <andres@planetscale.com>

Co-authored-by: Harshit Gangal <harshit@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-08-02 11:41:06 +02:00
Matt Lord bf13249082
Add MySQL 8 Support to Backup Tests (#10691)
* Add support for MySQL 8.0 in backup tests

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add 8.0 workflow

Signed-off-by: Matt Lord <mattalord@gmail.com>

* whitespace

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use vtctldclient SetKeyspaceDurabilityPolicy to manage semi-sync

This needed to be done after the shard was setup in order to satisfy
the semantic assumptions related to semi-sync in the tests.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove extraneous changes

Signed-off-by: Matt Lord <mattalord@gmail.com>

* We need lz4 for TestXtrabackupStreamWithlz4Compression

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Try using Percona Repo for MySQL 8 to align mysqld and xtrabackup versions

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Specify stream type everywhere

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove repeated server install

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Moar...

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Move vtctlbackup test to 8.0

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Rename vtbackup test and move to MySQL 8

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Split the xbstream tests so the workflow doesn't time out

Otherwise it was going over the 10min limit and getting
killed.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use MySQL 8 compat method for setting passwords

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Test increasing timeout at another level

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Don't use the init passwords file with 8.0

mysqlctl doesn't start...

This is likely due to the change in initialization behavior with
MySQL 8.0 as it goes though two phases and you can't simply
start up mysqld and pass it data, it has to initialize and restart
first.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Fix incorrect password update statement for vt_repl user

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Bump timeouts for 8.0 backup tests

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Bump it more :(

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Increase backup/restore timeout in backup_utils

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Apply new 8.0 template everywhere

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Fix bugs around how the compression flags were getting passed

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use 45m timeout for the workflow, 30m for the run.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* These changes were no longer needed so limiting diff.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Explicitly skip new linter check

Signed-off-by: Matt Lord <mattalord@gmail.com>

Co-authored-by: Rohit Nayak <rohit@planetscale.com>
2022-07-20 12:54:56 -07:00
Harshit Gangal 8755887a6b
Parameterize BIT types and fixes in HEX types (#10689)
* feat: add parsing for bitnums

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add invalid cases to tests

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: normalize bitnums to bit vals too

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add normalization for bit literals

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: parameterize binary value to hex

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: added e2e test in vtgate and vttablet

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* fix: fix the type conversion from hexnum and hexval to binary

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: refactor test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* fix: return varbinary and flaghex for hexval and hexnum in eval engine typeOf

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: separate expectation for mysql and vitess result

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: fix test expectation

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* feat: added bitnum bind variable and test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* proto: vtadmin side update

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: fixed test and added more bitnum bind var test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* added license header

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-07-20 11:48:14 +05:30
Matt Lord 8f35846dba
Flakes: Increase timeouts for upgrade_downgrade workflows (#10735)
* Increase timeouts for upgrade_downgrade workflows

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove errant addition

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-07-19 15:20:29 +05:30
Manan Gupta 71265d05b3
Fixes to config file and flakiness fix for TestFloatValueDefault (#10710)
* test: fix flakiness in TestFloatValueDefault by adding ordering to the query

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove tabletgateway_cellalias config since it points to a directory which doesn't exist

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove redundant test which tries to run test that doesn't exist

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-07-16 14:25:46 +02:00
Rohit Nayak 8fabdd919b
MoveTables: use source timezone to adjust datetime columns on update statements (#10667)
* Fix bug where update statements were not converting the timezones if source_timezone was specified

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Try moving the conversion test to the migrate/vdiff2 workflow.

Signed-off-by: Matt Lord <mattalord@gmail.com>

Co-authored-by: Matt Lord <mattalord@gmail.com>
2022-07-12 11:08:33 +02:00
Rameez Sajwani 3256526782
Backup/Restore: add support for external compressors and decompressors (#10558)
* change to support an external decompressor

Signed-off-by: Renan Rangel <renan@slack-corp.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* add external compressor support + builtin additional compressors

Signed-off-by: Renan Rangel <renan@slack-corp.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* wrap external compressor/decompressor

Signed-off-by: Renan Rangel <renan@slack-corp.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* go mod tidy + comments

Signed-off-by: Renan Rangel <renan@slack-corp.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* add copyright notices

Signed-off-by: Renan Rangel <renan@slack-corp.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* add support for builtin engine

Signed-off-by: Renan Rangel <rrangel@slack-corp.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Adding test case for buckup compression

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fixing unit test and run mod tidy

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Removing unwanted unit tests

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Increase timeout of backup tests

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing linter errors

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Change test logic to accomodate running selective tests

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* removing lint warning

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing test failure

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Removing un-necessary test

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fixing code review feeback

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Change builtinEngine to consider 'auto' decompressor

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing Upgrade/Downgrade test

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fix type & add summary under release notes

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fixing typos in summary

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fixing flag name typos

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Co-authored-by: Renan Rangel <rrangel@slack-corp.com>
Co-authored-by: Renan Rangel <renan@slack-corp.com>
2022-07-07 12:16:07 -07:00
Matt Lord a1f1f12be8
Delete all legacy sharding related code (#10278)
* Delete all legacy sharding related code

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Move used until functions from initialsharding to cluster

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove vtctl commands

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Kill vtworker and SetKeyspaceServedFrom cmd

Signed-off-by: Matt Lord <mattalord@gmail.com>

* WaitForDrain related stragglers

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Legacy local straggler workflow

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Get rid of SetKeyspaceShardingInfo & wait for drain stragglers

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove vtworker stragglers

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Update throttlerservice protobuf

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Rename test 24, add hashicorp vault test to it (now mysql_server_vault)

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove last mentiones of legacy sharding in vtctl

Signed-off-by: Matt Lord <mattalord@gmail.com>

* remove binlog_use_v3_resharding_mode

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Address review comments

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Address review comments

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Correct vtgate help output

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-07-07 13:52:32 -04:00
Harshit Gangal dc22f76172
[14.0] Schema tracking acl error logging (#10591) (#10637)
* feat: log acl warn error when schema tracking fails with unauthorized or permission error

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* feat: modified logging message for acl and improved testing time

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-07-06 17:22:32 +05:30
Manan Gupta 5c00d9e85a
Use introduced tablet manager RPCs in VTOrc (#10467)
* feat: use the new RPC for resetting replication

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add code to get the full status and use it

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove uptime from instance propoerties in VTOrc

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add end to end test for checking the output of ReadInstanceBufferable

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove a mysql query for server id, etc and use full status information instead

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: use primary status output instead of mysql query

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove semi-sync available, since it is unused

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: use semi sync enable from full status instead of mysql query

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: use semi sync statuses from full status instead of mysql query

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: check output of more fields in the test

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: remove ReplicationCredentialsAvailable since it is unused

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: use executed, purged gtid set, server uuid, gtid mode and binlog row image from full status instead of mysql query

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: add testing for replication status fields

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: check for nil values to prevent panics when some fields are empty

Signed-off-by: Manan Gupta <manan@planetscale.com>

* feat: use replication status from full status instead of mysql query

Signed-off-by: Manan Gupta <manan@planetscale.com>

* test: add license and shorten package name

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-06-22 06:34:06 +05:30
Harshit Gangal a595babb65
Fix: handle all cases for consistent lookup unique on single transaction mode (#10493)
* test: added failing e2e test

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* feat: proto changes for vindex_only shard session

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* session to ignore multi-db transaction error if shard session is used only for vindex query

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: added additional e2e tests that fails

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* feat: claim a vindex only session if other query uses it

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* refactor: addressed all review comments

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-06-19 14:19:42 +05:30
FlorentP 4fe33add59
Divide query serving upgrade downgrade tests in two groups to limit disk usage per workflow (#10452)
* Removed keep-data from query serving upgrade downgrade tests

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Split query serving upgrade downgrade tests in two groups (schema and queries)

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-06-07 11:56:26 +02:00
Rohit Nayak e8c2cc088c
Vdiff2: initial release (#10382)
* VDiff2: rearchitect VDiff to run on tablets

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Improve show summary output and add 'show last'

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Improve e2e test

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* go mod tidied

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* regenerate vtadmin protos

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Minor tweaks/improvements to the e2e test

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Another round of minor tweaks

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use UUID types directly and remove string literals

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Another round of minor tweaks

Signed-off-by: Matt Lord <mattalord@gmail.com>

* You guessed it!! More minor tweaks

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Improve handling of last and all with no results

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Remove double printing for show all output

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Return empty json array for empty show all results

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add vdiff2 test to CI

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Trigger rebuild

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Another round of tweaks during review

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Final round of code tweaks

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Correct has_mismatch handling

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Adjust reporting for extra/mismatched row samples

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use proto.Clone to copy VStreamRowsResponse

And use small vstream_packet_size in e2e test.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Refactor tests. Call VDiff2 side by side with all VDiff1s. Currently failing m2m3 test workflow.

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Add doc.go to package and use a const for trunctated notation

And rename readme.md to README.md so that it is listed first
in lexicographical order.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Correct year in header for new doc.go file 🤦

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Fix bug where we were not using in_keyrange() for filtering from source. Change logic to update table level mismatch flag to post-reconciliation of extra rows. Enhance vdiff2 test to include split/merge and full merge (working, but needs code refactoring).

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Use unbuffered channels in VDiff2 goroutine comms

TL;DR — I think it was because we were using buffered channels in the table
differ. So the order was not guaranteed and could be off by 1. I suspect the
deep copy synchronized things as a side effect.

I think it may also explain why even after the previous test correction
to return in the wait after sending true to the results channel, vtctlclient
would sometimes get another result after things were torn down. Because the
channels were buffered, where the comment says that we block, we didn’t
until there was 1+1 messages sent to the channel and the order was not
enforced between the goroutines.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Increase vdiff timeout

Signed-off-by: Matt Lord <mattalord@gmail.com>

* VDiff2 does not support inter cluster diffs today

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Go back to using buffered chans for the vstreams

Added a comment explaining why we *want* to do the Clone here.

If we need other synchronization points in the code paths then we
can handle that independently.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Refactor vdiff2 tests

Signed-off-by: Rohit Nayak <rohit@planetscale.com>

* Minor tweaks after final review

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Correct test config after merging main branch

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add VDiff2 to the v14 release notes summary

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Help output should not show --v2 as defaulting to true

And add note about how to use VDiff2 with example usage to the
release notes summary.

Signed-off-by: Matt Lord <mattalord@gmail.com>

Co-authored-by: Matt Lord <mattalord@gmail.com>
2022-06-07 11:54:18 +02:00
rsajwani 21a49b50dc
topo: cache CellInfo along with conn (#10408)
* topo: cache CellInfo along with conn

Co-authored-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* fixing config.json

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Regenrating cache yaml

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

* Fixing typos in comments

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Co-authored-by: Deepthi Sigireddi <deepthi@planetscale.com>
2022-06-06 12:51:19 -07:00
Andres Taylor dccb07e1cc
fix V3: only use the special NoRoute handling mode when needed (#10422)
Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-06-04 07:54:50 +02:00
FlorentP 4214b41a3d
Fix schema tracking issue when `PRIMARY` tablet changes (#10335)
* Improved schema tracking E2E test with PRS

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Keep track of current tablet information everytime we receive a healthcheck response

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Use the target tablet type in the update_controller of schema tracking

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Add new E2E test to config.json

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Remove fix in the healthcheck

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* reduced the size of cluster in schema tracking PRS sharded E2E test

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Do not test TestAddColumn is vtgate < v14

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

* Retry waitForVTGateAndVTTablet when WaitForTabletsToHealthyInVtgate returns an error

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-05-23 11:01:55 -04:00
Matt Lord f7d6c0d4a3
Address flakiness of vtgate_vindex.prefixfanout tests (#10216)
* Wait for vtgate and tablets to be healthy in prefixfanout tests

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Setup already waits for vtgate proceess to be healthy

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Let's give tablets more time to become healthy

Sometimes GitHub Actions is *super* slow and our tests should
still be able to pass.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Wait longer and check more frequently

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Mark vtgate_vindex test as heavy

Signed-off-by: Matt Lord <mattalord@gmail.com>

* 60s is a more than reasonable upper limit in tablet+mysqld startup

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Also rename 17->vtgate_general and mark as heavy

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Update test config to match workflow renames

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Rename 20 to xb_backup

And get related files aligned

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Actually wait for all tablets in all shards to be healthy

We were waiting for 1 replica tablet when the clsuter defined
for the test did not have any replica tablets.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* We need to reset the replica and rdonly table counts for each shard

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add log msg and get rid of extra flags added

Signed-off-by: Matt Lord <mattalord@gmail.com>

* run CI tests again

Signed-off-by: Matt Lord <mattalord@gmail.com>

* run CI tests one last time for goodness sake

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Minor correction to new Info log msg

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-05-04 23:02:40 -04:00
Manan Gupta 4535fcd3a4
Move Shard 12 and 18 CI tests to self hosted runners (#10025)
* ci: move shard 12 tests to self-hosted runners

Signed-off-by: Manan Gupta <manan@planetscale.com>

* ci: move shard 18 tests to self-hosted runners

Signed-off-by: Manan Gupta <manan@planetscale.com>

* ci: move cellalias to cluster-13

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-04-06 21:39:26 +05:30
Matt Lord 3d4f40041e
Support throttling vstreamer copy table work on source tablets (#9923)
* Support throttling vstream work on source tablets

This provides mechanisms to limit the impact of large vreplication
workflows on production source tablets.

It supports throttling based on the InnoDB history list length and
the replication lag seen.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add unit and e2e test for copy table throttling

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use shorter internal name for max replica lag seconds

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Use consistent case for json vars in config test

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add MySQL specific context to flags

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add copy table row streamer stats

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Rearrange things to wait for MySQL in initial row stream and copy phase cycles

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Correct & improve on e2e and unit tests

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Update test config

I spent way too much time trying to get both tests to work within
the same go test run... giving up for now.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Adding additional stats work

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add ability to modify the RowStreamerConfig at runtime via /debug/env

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add current RowStreamerConfig values to /debug/vars

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Add waitingForMySQL stats to vreplication phase timings

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Track waitForMySQL by table on vstreamer side

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Move row streamer config export to vstreamer engine

And make it a gauge so that it's always showing the current value
as we allow this to be changed in the running process via /debug/env.

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Minor changes after self review

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Shorten/generalize InnoDB row history test func names

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-04-04 20:51:23 +02:00
Harshit Gangal 2b7e2ef42e
Fix: reserved connection retry logic when vttablet or mysql is down (#10005)
* fix: when mysql is down and vttablet is up

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* fix: in reserved conn with no transaction if the queryservice i.e vttablet is down then it should go through gateway

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* refactor: execute and streamExecute should be able to reset the shard if needed and not executeLock

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* test: e2e test for bug fix

Signed-off-by: Harshit Gangal <harshit@planetscale.com>

* fix: when mysql is down, query should go through gateway to elect new healthy tablet for the given tablet_type

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-03-31 12:06:28 +05:30
Manan Gupta f500f6ec33
Move VTOrc tests to run against MySQL 8.0 (#9974)
* ci: make vtorc tests run against mysql 8.0

Signed-off-by: Manan Gupta <manan@planetscale.com>

* CI: run vtorc tests on both mysql versions

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-03-28 09:37:13 -07:00
Matt Lord 31bbb4fa32
Address flakiness of some cluster e2e tests (#9967)
* Rename cluster test 23 and set LimitResourceUsage for it

Signed-off-by: Matt Lord <mattalord@gmail.com>

* Rename shards 11,14,16 and set LimitResourceUsage for them

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-03-23 16:11:36 -07:00
Andres Taylor 2ea7ac99be test: give shard 23 three tries to succeed since it is so flaky
Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-03-11 11:13:29 +01:00
Harshit Gangal 2185504bdc test: added lookup table test for insert select
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-02-27 14:04:05 +05:30
Shlomi Noach fca59bc33c
Merge pull request #9719 from planetscale/schemadiff
Introducing schemadiff, a declarative diff for table/view CREATE statements
2022-02-24 06:16:38 +02:00
Matt Lord 1465e06c87
Replace usage of weight_string with vitess collation usage
Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-02-21 13:42:08 -05:00
Matt Lord 0ef143bd5f
Add new cross DB version vrepl e2e test
Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-02-21 13:42:07 -05:00
Rohit Nayak 43ed7f7d26
Retry v2 only once. Bypass lag check for now since it seems to make CI flaky for some reason
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-02-17 23:55:51 +01:00
Shlomi Noach 7a932b70d4 introducing schemadiff, a library to diff tables and views based on declarative schemas using go/vt/sqlparser and without need for a backend database
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2022-02-15 14:59:36 +02:00
Florent Poinsard 0a91e9052f test: test simplest form of backup test
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-01-25 06:57:34 +01:00
Florent Poinsard db56807f7d feat: addition of the testing steps in upgrade downgrade backups workflow
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-01-25 06:57:34 +01:00
Deepthi Sigireddi 56e9dd8d8c
Merge pull request #9473 from planetscale/upgrade-downgrade-reparent
Add upgrade downgrade tests for reparent
2022-01-11 15:16:48 -08:00
FlorentP dcd24f86ea
Merge pull request #9300 from planetscale/upgrade-downgrade
Upgrade Downgrade Testing
2022-01-06 11:50:27 +01:00
Manan Gupta b47968e4bb test: update config file to add the new package there
Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-01-06 16:15:59 +05:30
Manan Gupta 8f2008b6b7 feat: add correct tag to reparent tests
Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-01-06 15:46:05 +05:30
Rohit Nayak fe4f1d04cb
Merge pull request #9335 from planetscale/rn-materialize-9314
Allow source columns to be specified multiple times in a vreplication rule filter
2022-01-05 17:09:31 +01:00
Florent Poinsard 69276becf4
feat: change the list of included tests for the upgrade downgrade suite
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-01-04 16:58:59 +01:00
Florent Poinsard da0da1602b feat: include more E2E tests in the upgrade downgrade suite
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-01-04 13:59:22 +01:00
Florent Poinsard efbc3bc590 feat: testing a new end to end test package for query serving in the upgrade downgrade testing workflow
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-01-04 13:59:21 +01:00
Manan Gupta 29f2782f39 test: fix config file for vtorc tests
Signed-off-by: Manan Gupta <manan@planetscale.com>
2021-12-17 17:00:37 +05:30
Shlomi Noach 82c2eafb17 merged main; resolved conflict
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2021-12-09 08:42:01 +02:00
Rohit Nayak 7c93d32de5
Run all materialize e2e tests from a single test
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2021-12-07 21:21:02 +01:00
Shlomi Noach eebdf2023e merged main; resolved conflict
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2021-12-05 11:17:21 +02:00