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

32086 Коммитов

Автор SHA1 Сообщение Дата
Rameez Sajwani 0769945843
[cli] [zkctld] Migrate all zkctld flags to pflag (#11329)
* [cli] [zkctld] Migrate all zkctld flags to pflag

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

* fix default

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

* moving parse flag to right place

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

* code review

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

* add test

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-28 15:24:40 -04:00
Andrew Mason 8858cef1b2
[grpcclient] Migrate `--grpc_auth_static_client_creds` to pflag (#11367)
* [grpclient] Migrate `--grpc_auth_static_client_creds` to pflag

This was missed in #10806.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [grpcclient] Migrate test setters for `--grpc_auth_static_client_creds`

- Relates to #10934.
- Relates to #10979.
- Closes #10891.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-28 14:47:05 -04:00
Andrew Mason c515216e94
[flagutil] Cleanup `flag` references (#11381)
This:
- Corrects an initial migration of the `DualFormat*` functions to
  _actually_ install the flag on the passed in flagset, rather than the
  global one.
- Updates `StringListVar` to fully-implement `pflag.Value`, mimicking
  pflag's `StringSlice` implementation for this method.
- Removes the compile-time type-check on `StringSetFlag` implementing
  `flag.Value` (which is a subset of `pflag.Value` anyway), as well as in
  the test code.

Closes #11296.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-28 13:56:32 -04:00
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
Shlomi Noach a13b6529c8
Remove deprecated IsSkipTopo() function (#11377)
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2022-09-28 09:41:27 -07:00
Manan Gupta e5dc1ed49c
feat: move evalengine integration tests to use pflags (#11378)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-28 21:01:51 +05:30
Andrew Mason a984f9e624
[vtctlclient] Migrate `vtctl_client_protocol` to pflag (#11368)
* [vtctlclient] Migrate `vtctl_client_protocol` to pflag

Closes #10892.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* forgot to update testdata

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-28 11:15:30 -04:00
Rameez Sajwani cf4acaaae3
[cli] [vtgate/vschemaacl] Migrate VschemaACL flags to pflags (#11315)
* [cli] [topo/consultopo] Migrate VsSchemaACL flags to pflags

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

* test fix

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

* fix TestHelpOutput

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

* Adding flag to vtcombo and vttestserver

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

* remove flag from vttestserver

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

* moving flag registration to vschemaacl init

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

* fixing spacing issue

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

* removing flag from vtexplain

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-28 06:44:44 -04:00
Rameez Sajwani 38cf714e74
[cli] [topo] Migrate topo2topo flags to pflags (#11327)
* [cli] [topo] Migrate topo2topo flags to pflags

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

* Fixing some pflag error

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

* removing _flag.parse call from main

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

* fixing defaults

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

* moving flag registration to init

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

* code review

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-28 06:41:54 -04:00
Harshit Gangal 8b1cce4701
handle cache key types (#11369)
Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-28 11:12:47 +05:30
FlorentP c3f414b687
Migrates `release-notes` to pflag (#11365)
* Migrates release-notes to pflag

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

* apply review suggestions

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-09-28 10:10:28 +08:00
FlorentP e157ab7033
Add hyperlink in the release changelog (#11241)
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-09-28 09:40:03 +08:00
Matt Lord d72eb50223
Move vttlstest to pflag and cobra (#11361)
* Move vttlstest to pflag

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

* Address review comments

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

* Intermediate changes, before going full pflag

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

* Move vttlstest to Cobra

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

* Minor improvements after external and self review

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

* Correct Use for createCACmd

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

* Correct CLI syntax in TestSecure e2e test

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-27 19:57:57 -04:00
Rohit Nayak 4f1ad8548e
[cli] Migrate miscellaneous components from flag to pflag (#11347)
* Migrate go/stats

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

* Migrate go/vt/binlog/binlogplayer

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

* go/vt/binlog/grpcbinlogplayer

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

* Migrate mysqlclient, throttlerclient and throttler demo

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

* Migrate vtctl/grpcclientcommon

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

* Update help output

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

* Fix test failures in vttestserver help output. Minor refactor

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

* Remove logs added for testing

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

* Address review comments

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

* use StringSliceVar for CommonTags

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

* Fix vtctldclient flags and update help output for vtctlclient

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

* Set zero duration correctly

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

* Fix help output test

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

* Fix help output test

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

* update help output

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

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-09-27 12:54:32 +02:00
Andres Taylor 60325f349d
[asthelpergen] Migrate to pflags (#11363)
Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-09-27 11:19:16 +02:00
Harshit Gangal 6da641acb9
refactor: minor refactor in partial shard routing and change in flag to dashes (#11357)
Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-27 14:42:37 +05:30
Andres Taylor 00600f5c23
fix: store the output of the rewrite (#11362)
Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-09-27 09:15:12 +02:00
Rameez Sajwani 32d0df7727
[cli] [mysqlctl] Migrate mysqlctl flags to pflags (#11314)
* [cli] [topo/consultopo] Migrate mysqlctl flags to pflags

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

* Test fix

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

* code review

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

* Fix TestHelpOutput test

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

* Adding correct help file for TestHelpOutput

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

* code review feedback

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

* fixing help output files

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

* adding parseflag in vtctldclient main

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

* updating vtctldclient help file

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-27 12:13:41 +05:30
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
Harshit Gangal 8927b1418a
advisory lock to acquire reserve connection only for get_lock (#11359)
Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-27 09:46:50 +05:30
Deepthi Sigireddi 375d2d7925
Delete deprecated flags (#11360)
* flags: remove deprecated from test comment

Signed-off-by: deepthi <deepthi@planetscale.com>

* flags: remove deprecated planner_version flag

Signed-off-by: deepthi <deepthi@planetscale.com>

* flags: remove deprecated master_connect_retry flag

Signed-off-by: deepthi <deepthi@planetscale.com>

Signed-off-by: deepthi <deepthi@planetscale.com>
2022-09-26 19:37:03 -07:00
Manan Gupta d281e580a1
feat: fix flags in vttestserver run script (#11354)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-26 10:55:12 -07:00
FlorentP 648be4e0cf
Fix frouioui in the MAINTAINERS.md file (#11343)
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-09-26 09:04:40 -07:00
Manan Gupta 7b5eb86f58
Flakiness Fix: Tests for GracefulPrimaryTakeover (#11355)
* feat: add some helpful logging to graceful primary takeover call

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

* test: retry API calls if they return cannot deduce cluster primary

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-26 09:03:51 -07:00
Harshit Gangal 5394719517
vtgate pflags migration (#11318)
* [go/cmd/vtgate] migrate to pflags

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

* [go/vt/vtgate/vtgateconn] migrate to pflags

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

* fix test

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

* [go/vt/vtgate] migrate to pflags

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

* move to non pointer

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

* change test flag usage

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

* update the test expectation for help output

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

* addressed review comments

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

* make vtgateprotcol flag variable as private

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

* fix test usage

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-26 19:35:22 +05:30
Manan Gupta 682a62ec94
Fix adding flags to vtctlclient and vtctldclient (#11322)
* feat: fix adding flags to vtctlclient and vtctldclient

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

* feat: add vtctlclient and vtctldclient to flag tests

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

* feat: remove tracing from both binaries

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

* feat: fix imports in vtctlclient

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

* feat: fix test output

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

* feat: fix vtctdclient output

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-26 17:49:41 +05:30
Andrew Mason d7e0d26935
Fix tablet debug/env template variable name (#11348)
Fixes #11346.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-26 06:44:35 -04:00
Rameez Sajwani 6d6dee7751
[cli] [vtctld] Migrate vtctld flags to pflags (#11326)
* [cli] [vtctld] Migrate vtctld flags to pflags

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

* TestHelpOutput fix

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

* code review

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

* Fix TestHelpOutput

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-26 06:36:06 -04:00
Olga Shestopalova bb24a46ede
vtcombo mutates options, make a copy to avoid this (#11223)
* vtcombo mutates options, make a copy to avoid this

Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>

* move copying and add e2e vtcombo test

Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>

* undo incorrect comment update

Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>

* fix import order

Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>

Signed-off-by: Olga Shestopalova <oshestopalova@hubspot.com>
Co-authored-by: Olga Shestopalova <oshestopalova@hubspot.com>
2022-09-26 15:26:50 +05:30
Brian Ramos 6bee2fe415
[vtgate] Add flag to pool connection read buffers (#11167)
* Add mysql_server_pool_conn_read_buffers flag and thread through to listener and connection

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

* review feedback: code style

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

* fix endtoend test

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

* run benchmarks with read buffer pooling, too

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

* update flag name to match new conventions

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

* update 15.0.0 summary with reference to new flag

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

* an attempt at cleaning up branch for rebasing

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>

Signed-off-by: Brian Ramos <brirams@users.noreply.github.com>
2022-09-26 15:25:08 +05:30
Rohit Nayak bb479cb0df
[cli] Migrate cmd/vtclient and cmd/vttablet from flag to pflag (#11349)
* Migrate vtclient

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

* Migrate cmd/vttablet

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

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-09-26 12:17:17 +05:30
Andrew Mason 50b536d777
[cli] Migrate cmd/vtctld to pflag (#11350)
* [cli] Migrate `vtctld` flags to `pflag`

Closes #11282.

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* add new flag to transition to proper DurationVar flags

Signed-off-by: Andrew Mason <andrew@planetscale.com>

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-26 12:11:00 +05:30
Manan Gupta 688d474e9e
Addition of Metrics to VTOrc to track the number of recoveries ran and their success count. (#11338)
* feat: add metrics for counting recoveries and their success and failures in vtorc

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

* feat: add metric for counting pending recoveries

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

* feat: add end to end testing for some metrics

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

* test: reduce flakiness in tests

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

* test: reduce flakiness in e2e tests

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-26 11:34:17 +05:30
Harshit Gangal 9bac8aa807
customrule pflags migration (#11340)
* customrule pflags migration

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

* addressed review comments

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-24 19:07:39 +05:30
Harshit Gangal 29c1e66592
srvtopo pflags migration (#11341)
* migrate to pflags in srvtopo

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

* updated help output expectation

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-09-24 19:07:14 +05:30
Frances Thai ce558fc4aa
[VTAdmin] RebuildKeyspaceGraph, RemoveKeyspaceCell, NewShard (#11249)
* Add RebuildKeyspaceGraph

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Run lint:prettier:fix

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Connect to backend

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Add skeleton for RemoveKeyspaceCell

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Add javascript equivalent of removeKeyspaceCell

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Connect remove keyspace cell in UI

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Run prettier

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Add skeleton of create shard

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Connect CreateShard to UI

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Use underscores and fix lint issue

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Remove unused component

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Run prettier

Signed-off-by: notfelineit <notfelineit@gmail.com>

* Restart the build

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

* Undo changes to unrelated protos

Signed-off-by: notfelineit <notfelineit@gmail.com>

Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-09-23 10:01:23 -07:00
Andrew Mason d194a57570
[vtctlclient] Migrate to pflag (#11342)
* add vtctlclient help to endtoend data

Signed-off-by: Andrew Mason <andrew@planetscale.com>

* [cmd/vtctlclient] Migrate to pflag

Closes #11281.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-23 12:36:41 -04:00
Andrew Mason 0c305d0269
[cmd/vtctl] Migrate flags to `pflag` (#11339)
Closes #11280.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-23 09:42:29 -04:00
Manan Gupta b112de9854
[cli] `vttestserver` flag parsing to use pflags (#11321)
* feat: add vttestserver flags

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

* feat: fix parsing of flags in vttestserver to use pflags

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

* feat: fix parsing of flags that take in lists of strings

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

* test: update flags help output

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

* feat: fix tests to not pass the same argument twice

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

* test: fix help output after merging main

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-23 18:33:18 +05:30
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
Matt Lord 4218ff987d
Move go/mysql flags to pflags (#11272)
* Make mysql_server_flush_delay vtgate only pflag

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

* Add comment for go test flag

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

* Address review comments

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

* Remove mysql_server_flush_delay from vtorc help output

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-23 10:09:35 +05:30
Manan Gupta 03a9b0e274
Fix local example scripts (#11319)
* feat: fix 101_initiail_cluster to not run PRS, but instead wait for tablets to be up and primary promotion by vtorc

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

* feat: fix remaining binaries in local examples to not call ISP at all and instead rely on VTOrc to elect a primary

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

* feat: fix region-sharding example too to not call ISP

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

* feat: use _ instead of i in for loop since i is unused

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-23 09:44:02 +05:30
Arthur Schreiber 8af0a03838
Fix complex predicates being pulled into `ON` conditions for `LEFT JOIN` statements. (#11317)
* Fix complex predicates being pulled into `ON` conditions for `LEFT JOIN` statements.

Also convert `LEFT JOIN` statements with complex predicates into `INNER JOIN` when possible.

Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>

* Allow outer join simplification for `IS NOT NULL` expressions.

Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>

Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
2022-09-22 17:22:21 -07:00
Andres Taylor bf6aa7c197
bugfix: Truncate columns even when sorting on vtgate (#11265)
Fixes #11261

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-09-22 17:30:35 +02:00
Arthur Schreiber a76c774549
Fix conditions after `<=>` operator on left joined table columns being ignored for routing purposes. (#11310)
Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>

Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
2022-09-22 11:26:04 +02:00
Andres Taylor 97eb6ce1c1
feat: rewrite column names in HAVING (#11306)
* feat: rewrite column names in HAVING

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

* fix: make sure to figure out dependencies of count(*) when used in HAVING

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

* test: update expectations

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-09-22 09:22:57 +02:00
Manan Gupta bb300e9420
feat: improve PRS to also verify that the primary elect can make forward progress and test it (#11308)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-22 12:13:48 +05:30
Manan Gupta 02a20013c0
Introduce `servenv` status pages in VTOrc (#11263)
* docs: fix logging in vtorc http

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

* feat: add servenv and required flags to vtorc

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

* feat: add vtorc port to local and region sharding example

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

* test: add vtorc to flag help test

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

* feat: simplify vtorc parsing of flags

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

* feat: add redirect for unrecognized paths to /debug/status to vtorc

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

* feat: add a component to debug/status page of vtorc to display recent recoveries

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

* feat: simplify a condition in vtorc

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

* feat: fix command used for invoking vtorc

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

* feat: remove adding help flag and let servenv handle it

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

* feat: add vtorc servenv page to docker-compose example too

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

* feat: add prometheus plugin like we do for other binaries

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

* feat: change vtorc debug port to not conflict with vttablet's port

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

* feat: fix year in file license

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

* docs: add summary docs

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-22 10:48:45 +05:30
Manan Gupta 84d32bfa99
feat: move 12 and 18 back to github runners (#11273)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-22 10:19:28 +05:30