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

22755 Коммитов

Автор SHA1 Сообщение Дата
Matt Lord fbfd3f6fb0
[release-15.0] [Backport]: VReplication: Prevent Orphaned VDiff2 Jobs (#11768) (#11943)
* Prevent orphaned VDiffs in two ways...

1. When opening the engine, restart any vdiffs that are in the
   started state as this indicates it did not complete and was
   unable to save the final state and must be restarted.
2. When a vdiff run fails, retry saving the error state with an
   exponential backoff until the engine shuts down. This way
   the normal retry mechanism will kick in OR #1 will kick in
   when the engine is next opened on the primary tablet.

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

* Handle failures before vdiff_table records are created

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

* Add more ephemeral client errors

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

* Show vdiff state of error even if no vdiff_table records

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

* Minor cleanup

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

* Add vdiff2 unit tests

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

* Add unit test for retry

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

* Small cleanup

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

* Addressing review comments and other improvements

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

* Use warning log for ... warnings :-)

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

* Minor touch ups

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

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-12-13 11:53:57 -05:00
FlorentP 4df65a4756
bugfix: allow predicates without dependencies with derived tables to be handled correctly (#11911) (#11922)
* bugfix: allow predicates on top of derived tables to be handled without dependencies

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

* stop normalizer from changing literals into bindvars

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Andres Taylor <andres@planetscale.com>
2022-12-10 14:53:33 +01:00
vitess-bot[bot] 4faa45f55c
feat: add test and fix the error of not sending a ServerLost error on server side error (#11930)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-12-10 17:13:16 +05:30
FlorentP c4d606f320
Upgrade to `go1.18.9` (#11897)
* upgrade to go1.19.4

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

* apply gofmt

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

* regen proto

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

* use go1.18.4 and bootstrap 11.2

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

* fix go.mod

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

* re gen proto

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-12-09 11:06:41 +01:00
Manan Gupta 2dac92cb99
feat: fix checkMySQL and add tests and documentation (#11895) (#11900)
Signed-off-by: Manan Gupta <manan@planetscale.com>

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-12-07 22:05:57 +05:30
Dirkjan Bussink 7bdcac5c3b
Fix closing the body for HTTP requests (#11842) (#11853) 2022-11-30 17:14:16 +01:00
Rameez Sajwani 14d3106e8e
Back to dev mode (#11848)
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-11-29 17:28:05 -05:00
Manan Gupta 35460c2e5a
semantics: Use a BitSet (#11819) (#11837)
* make sure planner works well with more than 64 tables

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

* semantics: use an immutable bitset

Signed-off-by: Vicent Marti <vmg@strn.cat>

* bitset: add documentation

Signed-off-by: Vicent Marti <vmg@strn.cat>

* bitset: add license

Signed-off-by: Vicent Marti <vmg@strn.cat>

* use IsEmpty and NonEmpty more

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

* rename file

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

* bitset: better documentation

Signed-off-by: Vicent Marti <vmg@strn.cat>

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Co-authored-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Vicent Martí <42793+vmg@users.noreply.github.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
2022-11-29 21:36:11 +05:30
Manan Gupta 91af0b9c24
collations: fix coercion semantics according to 8.0.31 changes (#11487) (#11834)
Signed-off-by: Vicent Marti <vmg@strn.cat>

Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Vicent Marti <vmg@strn.cat>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Vicent Martí <42793+vmg@users.noreply.github.com>
Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-11-29 16:09:16 +05:30
vitess-bot[bot] 78deda2400
Consistent sorting in Online DDL Vrepl suite test (#11828)
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>

Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
Co-authored-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2022-11-29 08:30:35 +02:00
vitess-bot[bot] 4ea0f52af1
[release-15.0] Update test runners to run all tests including outside package (#11787) (#11792)
* Update test runners to run all tests including outside package

Sometimes it's necessary to have a separate _test package inside another
package. Our current test runner doesn't run such tests though, leading
to tests being broken without us knowing.

Worst case it hides real bugs. So we should always ensure to also run
these tests as well.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

* Fix tests

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-11-28 17:00:30 +01:00
vitess-bot[bot] e9bf372b23
Accept no more data in session state change as ok (#11800)
On MariaDB, it's possible that an OK packet has
`SERVER_SESSION_STATE_CHANGED` set to true, but it has no additional
state change information as the end of the packet is reached.

We should not treat this as an error condition and treat this as a
proper OK packet.

Fixes https://github.com/vitessio/vitess/issues/11795

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-11-28 09:18:38 +01:00
vitess-bot[bot] 8c7568bd16
[release-15.0] Switch ApplySchema `--sql` argument to be `StringArray` instead of `StringSlice` (#11790) (#11801)
* Switch ApplySchema `--sql` argument to be `StringArray` instead of `StringSlice`

Fixes #11785.

See [this comment](https://github.com/vitessio/vitess/issues/11785#issuecomment-1323641942)
for an explanation.

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

* add endtoend test

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

Signed-off-by: Andrew Mason <andrew@planetscale.com>
Co-authored-by: Andrew Mason <andrew@planetscale.com>
2022-11-24 13:34:04 -05:00
FlorentP 1a2f37c111
Addition of a CI tool to detect dead links in test/config.json (#11668) (#11712)
* Addition of a CI tool to detect dead links in test/config.json (#11668)

* Addition of a tool to detect unrequireed CI clusters in test/config.json

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

* move mysql80 derived to queries/derived in config.json

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

* test: clean the user table as well

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

* Fix flakyness in TestDerivedTableWithHaving

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

* Skip TestDerivedAggregationOnRHS

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

* Go mod tidy

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>

* apply go mod tidy

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
2022-11-16 00:25:16 -05:00
vitess-bot[bot] 0871a6eaae
[release-15.0] improve handling of ORDER BY/HAVING rewriting (#11691) (#11693)
* improve handling of ORDER BY/HAVING rewriting

Fixes #11641

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

* Go fmt file

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-11-15 16:46:28 -05:00
Harshit Gangal c1f79617e7
[15.0] Send errors in stream instead of a grpc error from streaming rpcs when transaction or reserved connection is acquired (#11687)
* Fix ordering when error happens during stream setup (#11592)

* Fix ordering when error happens during stream setup

When we already have an error during the stream setup, that errors needs
to be returned immediately.

Otherwise the stream will already be started and the error message is
never returned to the client and it silently looks like a success even
if it's a failure.

This in turn can result in an empty result for example when an error
would have been expected.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

* Add a bunch of testing to verify stream execute behavior

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

* Send errors in stream instead of a grpc error from streaming rpcs when transaction or reserved connection is acquired (#11656)

* wip

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

* feat: send errors in stream instead of a grpc error from streaming rpcs

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-11-11 14:39:35 +05:30
vitess-bot[bot] 5fe3d63440
[release-15.0] [bugfix] Allow VTExplain to handle shards that are not active during resharding (#11640) (#11652)
* VTexplain topology only uses serving shards

This addresses isse #11632 , which
causes vtexplain to sometimes give bad results if the keyspace is being
resharded, because sometimes it picks source shards and other times target
shards, for routing the query.

The issue is that the `VTExplain.buildTopolog()` adds both source and
destination shards to the map that holds shards per keyspace, when only one of
them is actually serving traffic at any point in time. Later on, vtexplain
loops over this map. Because looping over the map gives a non-deterministic
order, sometimes the results are correct, and sometimes incorrect - that is,
sometimes it gives the result of the shard that is serving, and other times,
the shard that is not serving.

This change ensures that only the serving shards are added to the shards per
keyspace map, thus avoiding the incorrect vtexplain.

Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com>

* This addresses issue #11632 , which
causes vtexplain to sometimes give bad results if the keyspace is being
resharded, because sometimes it picks source shards and other times target
shards, for routing the query.

The issue is that the VTExplain.buildTopolog() adds both source and
destination shards to the map that holds shards per keyspace, when only one of
them is actually serving traffic at any point in time. Later on, vtexplain
loops over this map. Because looping over the map gives a non-deterministic
order, sometimes the results are correct, and sometimes incorrect - that is,
sometimes it gives the result of the shard that is serving, and other times,
the shard that is not serving.

This change ensures that only the serving shards are added to the shards per
keyspace map, thus avoiding the incorrect vtexplain.

Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com>

* Fix check_make_vtadmin_authz_testgen

Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com>

* empty commit to trigger CI

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

Signed-off-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Eduardo J. Ortega U <5791035+ejortegau@users.noreply.github.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
2022-11-10 19:14:21 +01:00
FlorentP 039bb128c0
[release-15.0] Do not multiply `AggregateRandom` in JOINs (#11672)
* Do not multiply `AggregateRandom` in `JOIN`s (#11633)

* Do not multiply AggregateRandom in JOIN

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

* Update the releases notes with new known issue

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

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

* Addition of the release notes for v15.0.1

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

* Fix format issue in the release notes summary

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

* set sql mode in TestAggregateRandom

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-11-09 14:18:07 -05:00
vitess-bot[bot] 910df9b589
Fix missing flag usage (#11583)
Signed-off-by: Matt Lord <mattalord@gmail.com>

Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Matt Lord <mattalord@gmail.com>
2022-10-26 19:51:33 -04:00
Rameez Sajwani 3efbc33847
Back to dev mode (#11574)
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-10-25 22:58:14 +02:00
Rameez Sajwani 9b901a1d64
Release of v15.0.0 (#11573)
* Release notes for 15.0.0

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

* Release commit for 15.0.0

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-25 19:30:22 +02:00
vitess-bot[bot] df77bcf10d
Detect redo log location dynamically based on presence (#11558)
Instead of relying on a specific version check, detect if the new redo
log location is present or not.

This makes the backup logic independent from the version check against
MySQL. With this change, 8.0.30 can be backed up just as well as any
other version.

Solves the backup part of
https://github.com/vitessio/vitess/issues/11554 by removing the
dependency on the version check. There might be still other places where
that issue can crop up, but it solves the immediate breaking issue with
backups.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com>
2022-10-21 14:42:33 -07:00
Manan Gupta 6b2208beda
[15.0] Deprecate InitShardPrimary command (#11557)
* feat: deprecate initshardprimary

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

* feat: add summary docs

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

* feat: deprecate the correct command

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

* test: fix expected output

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-21 14:38:43 -07:00
Rohit Nayak 4848d696b6
Test flags: Update logic for parsing test flags to run unit tests within GoLand and to parse test flags in vtgate to allow running unit tests (#11551)
* Update logic for parsing test flags to run unit tests within GoLand. Parse test flags in vtgate to allow running unit tests

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

* Minor changes after self-review

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

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-10-21 13:44:35 +05:30
Rameez Sajwani 19527a609b
Removing redundant flags across binaries (#11522)
* removing redundant flags across binaries

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

* adding app pool flag back for some binaries

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

* running generate_ci on prscomplex.yml

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

* code review

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

* fixing markdeprecated error

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

* code feedback

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

* doing some minor changes

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

* fixing typo

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-20 10:58:40 -07:00
FlorentP 2e243048c7
Redact bind variables in mysql errors (#11540)
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-10-20 13:09:40 +02:00
FlorentP 4f125f3d64
Fix `HAVING` rewriting made in #11306 (#11515) (#11526)
* don't rewrite HAVING predicates that use table columns

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

* Revert the changes made in #11306

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>

* Fix early rewriter test

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Co-authored-by: Andres Taylor <andres@planetscale.com>
2022-10-20 13:04:26 +02:00
Harshit Gangal c2c9137547
[15.0] Fix: concatenate engine in transaction (#11534)
* test: added failing e2e test

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

* fix: sequence execution of concate engine when in transaction

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

* fix: concatenate fix for olap transaction

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

* fix: test race

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-10-19 17:33:17 +05:30
Harshit Gangal f453661eb2
Fix #11455 - skip vindex operations for `DELETE` statements against unsharded tables (#11461) (#11530)
* Only perform vindex logic for deletes against sharded keyspaces.

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

* Add a testcase covering deletes on an unsharded reference table.

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

* Check if target keyspace is unsharded instead of checking opcode.

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

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

Signed-off-by: Arthur Schreiber <arthurschreiber@github.com>
Co-authored-by: Arthur Schreiber <arthurschreiber@github.com>
2022-10-19 13:07:46 +05:30
Manan Gupta fb9e17864a
Properly deprecate flags and fix default for `--cell` (#11501)
* feat: fix default for cell flag in vtgate

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

* feat: deprecate --enable-query-plan-field-caching and --enable_query_plan_field_caching properly

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

* feat: properly deprecate prefill flags

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

* feat: properly deprecate filtered_replication_wait_time flag in switch writes

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-18 18:33:48 -07:00
Andrew Mason bd35ac6f6c
Allow version to be accessible via the -v shorthand (#11512) (#11528)
* Allow version to be accessible via the -v shorthand

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

* update help text

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

* fix nonidempotence for tests

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

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

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-10-18 16:27:33 -07:00
Frances Thai dab32ddc55
[VTAdmin] Cherry Pick Topology Browser (#11518)
* Add web side of topology components

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

* Add GetTopologyPath

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

* Add protos

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

* Add comment explaining why name is not needed at toplevel topo path

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

* Add GetTopologyPath to vtadmin

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

* Modify node code for non recursive

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

* Update logic for GetTopologyPath

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

* Render correct depth for nodes

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

* Add tests TestGetTopologyPath

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

* Add GetTopologyPath command

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

* Run lint prettier fix

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

* Consolidate DecodeContent to vt/topo package - can't put in vt/topo/topoproto because of import cycle

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

* Add rbac check for TopologyResource

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

* Update DecodeContent of zkcmd.go

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

* Update help text

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

* Run make proto again

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

* Run lint prettier fix

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-10-18 16:14:30 -07:00
Harshit Gangal 221efebf20
[15.0] fix: fail over reconnect in stream execution for connection with transaction (#11527)
* fix: stream exec once in case of transactional connection

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

* test: added e2e test

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

* generate ci worflow

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-10-18 17:42:09 +05:30
vitess-bot[bot] 52c36e6e1f
Do not backtick binary name (#11481)
I accidentally stumbled over the behavior outlined in
`flag.PrintDefaults` [1], which `pflag` replicates, specifically:

> The listed type, here int, can be changed by placing a back-quoted
> name in the flag's usage string; the first such item in the message is
> taken to be a parameter name to show in the message and the back quotes
> are stripped from the message when displayed.

[1]: https://pkg.go.dev/flag#PrintDefaults.

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

Signed-off-by: Andrew Mason <andrew@planetscale.com>
Co-authored-by: Andrew Mason <andrew@planetscale.com>
2022-10-17 14:57:44 -04:00
Rameez Sajwani d0d9831831
remove excessive logging (#11479)
* remove excessive logging

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

* code feeback

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

* fixing typo

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-15 10:37:44 -07:00
Harshit Gangal 1047f7e14c
Merge pull request #11506 from planetscale/15-cp-11309
[15.0] Fix query list override issue on mysql restart (#11309)
2022-10-15 21:34:23 +05:30
Rameez Sajwani 3160c294dc
removing unncessary flags across binaries (#11495)
* removing unncessary flags across binaries

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

* code review feedback

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

* fixing blank space

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-14 19:08:38 -07:00
Rameez Sajwani b2a654cd49
Adding deprecate message to backup hooks (#11491)
* Adding deprecate message to backup hooks

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

* adding markdeprecated

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

* fixing deprecation message

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

* fixing messaging

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

* fix flag name

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-10-14 16:04:25 -07:00
FlorentP fbacb8f9df
Upgrade to go1.18.7 (#11507)
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-10-14 10:14:13 -07:00
Manan Gupta e7a76ccd5f
[15.0] Fix VTOrc to handle multiple failures (#11489)
* feat: added test for vtorc not being able to handle mutliple failures and fix it

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

* test: fix code to delete rdonly tablet from the correct list

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-14 09:17:13 -07:00
Harshit Gangal c8f87b643c Fix query list override issue on mysql restart (#11309)
* test: added failing e2e test

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

* log txID and reserveID in stream execute

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

* fix: maintain list of qd per key on the map and check for current connection id while removing

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

* added additional comments

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

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-10-14 17:19:54 +05:30
Andres Taylor 11168e5c78
planner fix: using self-referencing columns in HAVING should not stack overflow (#11499)
Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-10-14 15:54:14 +05:30
FlorentP c44c56fce4
Plan order by `COUNT(X)` (#11420) (#11497)
* Plan order by Count()

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

* Clean up the new aggregation E2E test

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

* Push more order by needs to the select list

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

* Remove unrequired code in TestOrderByCount

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

* remove unwanted directory

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

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-10-14 12:20:54 +02:00
Harshit Gangal e5dbc203c2 test: added e2e test
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-10-14 09:51:19 +00:00
Harshit Gangal 72993ea1f2 fix: reserve connection to follow query timeout when outside of transaction
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-10-14 09:50:19 +00:00
FlorentP de606b6433
Skip TestComparisonSemantics (#11474) (#11475)
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-10-13 09:25:34 +02:00
vitess-bot[bot] bd8d5c8577
[release-15.0] [VTAdmin] `Validate`, `ValidateShard`, `ValidateVersionShard`, `GetFullStatus` (#11438) (#11452)
* Add validate

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

* Add validate to cluster page

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

* Run lint prettier fix

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

* Add UI for validate shard

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

* Add validateShard

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

* Run make web proto

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

* Refactor validation results and implement validateShard

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

* add http shards

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

* Add GetFullStatus

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

* Add keys and comment

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

* Run lint prettier fix

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

* Add ValidateVersionShard to vtctldclient

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

* Add ValidateVersionShard

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

* Update test for vtctldclient

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

* Add test for ValidateVersionShard

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

* run lint prettier fix again

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

* Modify during 1:1 with gomez

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

* Run lint prettier fix

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

* Address PR review comments

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

* Update indentation

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

Signed-off-by: notfelineit <notfelineit@gmail.com>
Co-authored-by: notfelineit <notfelineit@gmail.com>
2022-10-12 11:47:15 +02:00
Andres Taylor 8ef3ad0f0b
Use JSON for plan tests (#11430) (#11432)
* Use JSON for plan tests

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

* move vschemas into single directory

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

* indentation

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: FlorentP <35779988+frouioui@users.noreply.github.com>
2022-10-10 16:30:52 +02:00
Rohit Nayak 3ec636f719
Include stats flags in servenv so that those flags are included in the correct binary. (#11450)
Signed-off-by: Rohit Nayak <rohit@planetscale.com>

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-10-06 22:31:25 +02:00
Matt Lord d1568f5304
For partial MoveTables, setup reverse shard routing rules on workflow creation (#11415) (#11447)
* Testing....

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

* Setup reverse routing rules at the start of the first partial movetables. Enhance e2e test to test for this as well as switch the remaining shard so that all shards are switched

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

* Update display representation of state for partially moved keyspaces

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

* Test improvements

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

* Cleanup shard routing rules on cancel/complete

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

* Cleanup intermediate changes

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

* Fix DryRun TrafficSwitcher and its tests

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

* Support concurrent partial movetables for N keyspaces

And other minor changes after self review

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

* Avoid unnecessary save + rebuild steps

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

* Add secondary ordering for shard routing rules on to_keyspace

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>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Co-authored-by: Rohit Nayak <rohit@planetscale.com>

Signed-off-by: Matt Lord <mattalord@gmail.com>
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
Co-authored-by: Rohit Nayak <rohit@planetscale.com>
2022-10-06 13:17:11 -04:00
vitess-bot[bot] 74cf0dd611
[release-15.0] Fix VTOrc holding locks after shutdown (#11442) (#11448)
* feat: call the logic for waiting for shard locks on synchronous on-term hooks and add tests for it

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

* feat: fix comment for acceptSighupSignal function

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-10-06 14:44:31 +05:30
Rameez Sajwani ddf0620350
Back to dev mode (#11444)
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-05 21:35:54 +02:00
Rameez Sajwani be10ffbcd3
Release of v15.0.0-rc1 (#11443)
* Release notes for 15.0.0-rc1

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

* Release commit for 15.0.0-rc1

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-05 19:15:25 +02:00
Matt Lord 07387b872f
VDiff: Make restarting VReplication workflow more robust (#11413)
* When restarting workflow, use new context

Otherwise the restart will also fail due to the
expired/canceled context:
E0929 14:06:08.618848   85788 vdiff.go:247] Could not restart workflow commerce2customer: rpc error: code = Canceled desc = context canceled, please restart it manually
E0929 14:06:08.619983   85788 vtctl.go:2630] vdiff returning with error: rpc error: code = Canceled desc = context canceled

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

* Add retry when restarting workflows on ephemeral errors

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

* Correct mistake that prevented compilation :face-palm:

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-10-03 15:24:00 -07:00
Dirkjan Bussink e93e19708b
Move towards MySQL 8.0 as the default template generation (#11153)
* Move towards MySQL 8.0 as the default template generation

This upgrades the remaining things to Ubuntu 20.04 and makes MySQL 8.0
the default we run tests against. We still have tests for MySQL 5.7 but
those are now explicitly opted into.

This should finish up the Ubuntu 20.04 upgrade and also makes things
easier for the future when we need to upgrade again.

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>

* CI: rename shard vtorc_8.0 to vtorc_5.7, change expected test output for 8.0

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

* CI: increase timeout for 8.0 tests on the actual test step from 30 to 45 mins

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

* CI: increase timeout to 45 minutes for mysql57 tests too. We really only need this for vtorc, but I've made the change to the template so all tests get it.

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

* CI: fix vtorc test to work with both 5.7 and 8.0

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

* CI: missed docker flag in mysql57 template, one more fix to vtorc test

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

* removing spaces from pb file

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

* removing spaces in pb file part 2

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

Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Signed-off-by: deepthi <deepthi@planetscale.com>
Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Co-authored-by: deepthi <deepthi@planetscale.com>
Co-authored-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-10-03 14:04:57 -07:00
Andrew Mason 68e5398008
[cli] [vtctl] Migrate all vtctl commands to `pflag` (#11320)
* [cli] [vtctl] Migrate all vtctl commands to `pflag`

Closes #11304.

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

* fix test flags

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

* Handle subflag argument parsing without fully moving to cobra (yet!)

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

* update examples

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

* strip off double-dash

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

* Fix pflag getting tripped on shard 0 bounded shard names

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

* remove commented-out code

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

* update release notes

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

* fix ExecuteHook, which takes no flags

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

* add deprecation notice around interspersal

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

* fix flags for vtctld2 web calls

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

* Run make web_build

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

* test: fix vtctld_web_test

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

* update test assertions

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

* just double-dash everything

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

* Run make web_build

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

Signed-off-by: Andrew Mason <andrew@planetscale.com>
Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: deepthi <deepthi@planetscale.com>
Co-authored-by: notfelineit <notfelineit@gmail.com>
Co-authored-by: deepthi <deepthi@planetscale.com>
2022-10-03 10:21:31 -07:00
Manan Gupta 31fb403759
feat: add a function to get the flag set for a given command (#11424)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-03 10:21:05 -07:00
Andrew Mason 4a31b91391
Remove duplicated vt/log import (#11423)
Signed-off-by: Andrew Mason <andrew@planetscale.com>

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-10-03 20:13:34 +05:30
Max Englander 55695d155f
expose vtbackup stats at --port /metrics (#11388)
* expose /metrics from vtbackup http --port

Signed-off-by: Max Englander <max@planetscale.com>

* -mathrand seed

Signed-off-by: Max Englander <max@planetscale.com>

Signed-off-by: Max Englander <max@planetscale.com>
2022-10-03 19:55:33 +05:30
Andres Taylor 4342564603
fix: do not rewrite single columns in derived tables (#11419)
Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-10-03 12:42:40 +02:00
Harshit Gangal c7116c9075
test: deflake TestIdleTimeoutCreateFail (#11411)
Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2022-10-03 13:04:53 +05:30
Manan Gupta afda8928cd
VTOrc Standardisation and Cleanup (#11416)
* feat: remove unused package

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

* feat: replace usage of external test package with require

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

* feat: replace using external copied dependency with actual dependency

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

* feat: remove unused external package

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-03 11:57:44 +05:30
Rohit Nayak 958d5954d2
[cli] Topo: Migrate zk2topo and k8stopo to pflag (#11401)
* Migrate zk2topo and k8stopo to pflag

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

* Update flags help output

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

* Fix failing tests

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

* Fix help text output

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

* Fix help output

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

* Fix help text output

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

* Add vtorc to topo binaries

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

* Define k8stopo flags on all topo binaries. Change way flags are defined for tests

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

* Update test help output files

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

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2022-10-02 22:52:49 +02:00
Manan Gupta c9f018b49c
feat: fix vtbackup binary by adding the flags it needs (#11417)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-01 20:43:40 +05:30
Deepthi Sigireddi 3f73bdb7b0
flags etc: delete old flags and stats, add deprecation notice to release notes (#11402)
* flags etc: delete old flags and stats, add deprecation notice to release notes

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

* vrepl: fix tests to run SwitchReads with tablet_types flag instead of deprecated tablet_type

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

* pitr: fix tests to run SwitchReads with tablet_types flag instead of deprecated tablet_type

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

Signed-off-by: deepthi <deepthi@planetscale.com>
2022-10-01 13:04:31 +02:00
Manan Gupta 475a1d4c21
Enable VTOrc in backup tests (#11410)
* feat: enable vtorc in backup tests

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

* feat: reorder verifying initial replication to happen first

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

* test: increase timeout for VTOrc recovery to be successful and improve VTOrc performance

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-10-01 14:36:09 +05:30
Rameez Sajwani 0f310322f3
[cli] [topo] Migrate topo flags to pflags (#11393)
* [cli] [topo] Migrate topo flags to pflags

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

* fix vtorc test

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

* feat: fix VTOrc test

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

* feat: remove binaries from the list that don't need the flags

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

* test: update flag help outputs

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

* code review

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

* fix import formatting

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-09-30 19:19:38 -07:00
Rameez Sajwani 2e05ab06c6
[cli] [etcd2] Migrate etcd2topo flags to pflags (#11394)
* [cli] [etcd2] Migrate etcd2topo flags to pflags

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

* Fixing duplicate registration

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-30 14:59:24 -07:00
Michael a7eeeae103
fix: objname was not logged correctly (#11038)
Signed-off-by: Michael Gale <mgale@demonware.net>

Signed-off-by: Michael Gale <mgale@demonware.net>
Co-authored-by: Michael Gale <mgale@demonware.net>
2022-09-30 14:45:37 -07:00
Matt Lord c82dd87fc3
Move dbconfigs to pflag and remove deprecated flags (#11336)
* Migrate dbconfigs to pflag

And remove deprecated flags

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

* Remove no longer needed function

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

* Address review comments and test failures

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

* Revert this bit as it changed behavior and caused some failures

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

* Fix vttestserver unit tests

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

* Fix vttestserver unit tests

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

* Update vttestserver help output

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-30 17:14:10 -04:00
Manan Gupta 812a3efe81
feat: deprecate orchestrator integration and add release docs (#11409)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-30 23:33:39 +05:30
Frances Thai 201250b67d
VTAdmin: shard actions (#11328)
* Setting up page for shard actions

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

* Add delete shard to ui

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

* Complete UI for delete shard

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

* Make deleteShard redirect to shards list

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

* Add externally reparent

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

* Add TabletExternallyReparented

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

* Disable externally reparent if no tablet selected

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

* add all actions to rbac config when --no-rbac is configured'

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

* Connect up PlannedReparent

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

* Add tablet type to select box

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

* Show resulting logs after planned reparent

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

* Add emergency failover

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

* add max height to line area

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

* Run linter

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

* Update go/vt/servenv/grpc_server.go

Co-authored-by: Iheanyi Ekechukwu <iekechukwu@gmail.com>
Signed-off-by: Frances Thai <31225471+notfelineit@users.noreply.github.com>

* Address PR comments

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

* Run gofmt again

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

* Rename master --> primary

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

* Run prettier

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

* Update go/vt/servenv/grpc_auth.go

Co-authored-by: Iheanyi Ekechukwu <iekechukwu@gmail.com>
Signed-off-by: Frances Thai <31225471+notfelineit@users.noreply.github.com>

* Update web/vtadmin/src/components/inputs/Select.tsx

Co-authored-by: Iheanyi Ekechukwu <iekechukwu@gmail.com>
Signed-off-by: Frances Thai <31225471+notfelineit@users.noreply.github.com>

* Trigger GH actions

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

Signed-off-by: notfelineit <notfelineit@gmail.com>
Signed-off-by: Frances Thai <31225471+notfelineit@users.noreply.github.com>
Co-authored-by: Iheanyi Ekechukwu <iekechukwu@gmail.com>
2022-09-30 10:16:16 -07:00
Manan Gupta e7f98f859c
VTOrc Cleanup - Configs, APIs and old UI (#11356)
* feat: remove configurations that aren't needed like raft and initialization of database

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

* feat: use waitreplicastimeout for all timeouts related to waiting for execution on a replica

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

* feat: remove agents in vtorc since we don't use them

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

* feat: remove more unused configurations

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

* feat: cleanup post and pre processes that VTOrc doesn't intend to support

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

* feat: remove unused code and config for shell process

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

* feat: remove unused configurations

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

* feat: convert flags to pflag architecture

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

* feat: remove cli flags which aren't required

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

* feat: remove more unused configs

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

* feat: remove the old UI of orchestrator and cleanup app and http packages

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

* feat: remove web/vtorc files and fix Dockerfiles to not try to copy them

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

* feat: fix all the examples to not pass in the ListenAddress and not export port for the old UI

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

* feat: remove raft code and command applier

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

* feat: remove unused code and configs

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

* feat: remove more unused code

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

* feat: remove http configs that are no longer required

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

* feat: remove more unused configs and dead code

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

* feat: remove more unused configs

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

* feat: remove access tokens since they are unused

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

* feat: remove RecoveryPeriodBlockMinutes which was only for backward compatibility

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

* feat: remove unused package

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

* feat: remove replicas in instance since they weren't used anywhere

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

* feat: copy over vtorc things that vtgr was using to remove vtgr's dependency on vtorc package

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

* feat: change restart function to use tmc rpc calls

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

* feat: remove detection queries for vtorc since we read these from topo-server

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

* feat: improve read topology test to also verify the errantGTID set

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

* feat: use internal function to find difference in gtid sets instead of using the MySQL connection

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

* feat: remove population of group replication information

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

* feat: remove configs related to connecting to MySQL instances since it is no longer required

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

* feat: remove code to connect to MySQL backend since VTOrc now only uses SQLite3

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

* cleanup: go mod tidy

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

* feat: remove unused/redundant flags, we are down to 0 :)

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

* feat: remove filtering configs

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

* feat: remove write buffering and associated config parameters

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

* feat: remove more miscellaneous configs

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

* feat: remove one more rejection parameter

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

* feat: move discovery queue parameters to be constants

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

* feat: move some more configs to be constants

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

* feat: add flags for all the configurations we have kept

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

* feat: fix imports in main.go

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

* test: fix vtorc test output after so many changes

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

* feat: add release-notes docs for config changes

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

* feat: remove index definitions for tables that are already deleted

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

* feat: add API removal documentation as well to release notes

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

* feat: remove duplication of debug pages in release notes

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

* feat: use some flags in e2e test to verify they work

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

* feat: use sliceVar for the flag definition of cluster_to_watch

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

Signed-off-by: Manan Gupta <manan@planetscale.com>
2022-09-30 22:11:02 +05:30
Arthur Schreiber e17b4e16f9
Merge subqueries that "join" on lookup index columns. (#10966)
* Improved logic for subquery merging

This is a squash of a number of commits created by Arthur.

Co-authored-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>

* refactor: use existing functionality in ExtractedSubquery

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

* refactor: extract the ColName only once

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

* comments

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

* turn off linter that is wrong

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

* cleanup and commenting

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

* refactor and comments

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
Co-authored-by: Andres Taylor <andres@planetscale.com>
2022-09-30 18:21:56 +02:00
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
Andres Taylor 09728747f6
feat: add parsing for multiple paranthesis for derived tables (#11407)
Signed-off-by: Manan Gupta <manan@planetscale.com>

Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-09-30 15:32:22 +02:00
Andres Taylor db161bfbb9
gen4 planner: small cleanup (#11403)
Signed-off-by: Andres Taylor <andres@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-09-30 15:32:03 +02:00
Rameez Sajwani f7c19be8a6
[cli] [zkctl] Migrate zkctl flags to pflags (#11331)
* [cli] [vtctl] Migrate vtctl flags to pflags

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

* moving flag registration to init

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

* fix usage

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

* fix usage

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

* remove un-reachable codec

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

* adding exitonerror

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

* code review

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

* fix spacing issue

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Co-authored-by: Manan Gupta <manan@planetscale.com>
2022-09-30 17:55:40 +05:30
Rameez Sajwani 60c727afaa
[cli] [zk] Migrate zk flags to pflags (#11332)
* [cli] [zk] Migrate zk flags to pflags

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

* adding parseflag at right place

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

* move flag registration to init function

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

* some clean-up

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

* remove flag package completely

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

* code review

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

* change pointer to object

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

* fix static code check

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

* code review

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

* fixing pb.go

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

* fixing spacing for pb.go

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-30 14:27:34 +05:30
Matt Lord 770e06f327
Migrate ACL package to pflag (#11392)
* Move acl package to pflag

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

* Stragglers

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

* Gofmt after GH merge conflict resolution

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

* Merge in new vtbackup work

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

* Address linter errors:
context-as-argument: context.Context should be the first parameter of a function (revive)

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-29 13:40:27 -04:00
Andres Taylor 23c52854b7
Push down derived tables under route when possible (#11379)
* tests: add more plan_tests for derived tables and subqueries

Co-authored-by: Arthur Schreiber <arthurschreiber@github.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>

* refactor: make switch pretty

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

* feat: push derived table under the route

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

* simplify logic

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

* check for valid derived tables also when doing JOIN on the vtgate

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

* comments

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

* add more tests with derived tables

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

* handle HAVING in derived tables correctly

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

* merge tests into single file

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

* rename test keypspace

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Co-authored-by: Arthur Schreiber <arthurschreiber@github.com>
Co-authored-by: Harshit Gangal <harshit@planetscale.com>
2022-09-29 17:29:57 +02:00
Andrew Mason b3eab569a4
[cli] Use pflag/flag interop function in vtctldclient legacy shim (#11399)
Closes #11284.

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-29 10:14:32 -04: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
Andrew Mason 00efe3b865
[cli] Begrudgingly shim `flag.Parse` call to trick glog (#11382)
* [cli] Begrudgingly shim `flag.Parse` call to trick glog

I applied this to everywhere I think needs it.

- Closes #11283.
- Closes #11276.

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

* update test data after rebase

Signed-off-by: Andrew Mason <andrew@planetscale.com>
2022-09-29 06:12:03 -04:00
FlorentP 2c5535b421
Migrates `cmd/vtbench` to pflags (#11366)
* migrates cmd/vtbench to pflags

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

* Finish moving to pflags in vtbench

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

* Improve flags usage and logging in vtbench

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

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2022-09-29 17:21:55 +08:00
Phani Raj bccab3777b
Allow non-SSL callers of VTGate RPC APIs to specify group information for the CallerID (#11260)
* Add Groups to vtrpc.CallerID

Signed-off-by: phanatic <phanatic@github.com>

* fix formatting

Signed-off-by: phanatic <phanatic@github.com>

* update vtadmin proto

Signed-off-by: phanatic <phanatic@github.com>

* Add end-to-end test

Signed-off-by: phanatic <phanatic@github.com>

* remove comment formatting

Signed-off-by: phanatic <phanatic@github.com>

* add release notes

Signed-off-by: phanatic <phanatic@github.com>

* fix code formatting

Signed-off-by: phanatic <phanatic@github.com>

* fix vtgate help text

Signed-off-by: phanatic <phanatic@github.com>
Signed-off-by: <phanatic@github.com>

* refactor tests

Signed-off-by: phanatic <phanatic@github.com>

* run go mod tidy

Signed-off-by: phanatic <phanatic@github.com>

* bring back comment changes

Signed-off-by: phanatic <phanatic@github.com>

* rename flag to use dashes instead of underscore

Signed-off-by: Phani Raj <phani@planetscale.com>

* undo comment formatting by make proto

Signed-off-by: Phani Raj <phani@planetscale.com>

* fix formatting

Signed-off-by: Phani Raj <phani@planetscale.com>

* fix help text fixture

Signed-off-by: Phani Raj <phani@planetscale.com>

Signed-off-by: phanatic <phanatic@github.com>
Signed-off-by: <phanatic@github.com>
Signed-off-by: Phani Raj <phani@planetscale.com>
Co-authored-by: phanatic <phanatic@github.com>
2022-09-29 14:08:45 +05:30
Rameez Sajwani d1cd2a5a0a
[cli] [vtbackup] Migrate all vtbackup flags to pflag (#11334)
* [cli] [vtbackup] Migrate all vtbackup flags to pflag

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

* parsing flag for vtbackup

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

* code review feedback

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

* rename method

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

Signed-off-by: Rameez Sajwani <rameezwazirali@hotmail.com>
2022-09-29 11:06:49 +05:30
Matt Lord eb6506f951
Migrate mysqlctl command and package to pflag (#11391)
Signed-off-by: Matt Lord <mattalord@gmail.com>

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-29 11:00:22 +05:30
Andres Taylor 067cd8a626
[vtexplain] Migrate to pflags (#11364)
* [vtexplain] Migrate to pflags

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

* refactor for readability

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

* fixup vtexplain cmd: make use variables for defaults in all places

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

Signed-off-by: Andres Taylor <andres@planetscale.com>
2022-09-29 07:12:22 +02:00
Matt Lord a16013493b
Migrate mysqlctld from flag to pflag (#11376)
* Migrate mysqlctld from flag to pflag

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

* Minor flag help text cleanup

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

* Pedant can't stop, won't stop

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

* Update mysqlctld for new grpc client flag handling

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
2022-09-28 20:31:49 -04:00
Matt Lord 46b9b1d982
Move vtaclcheck command to pflags (#11372)
* Move vtaclcheck to pflags

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

* SetOutput on correct FlagSet

Co-authored-by: Andrew Mason <amason@hey.com>
Signed-off-by: Matt Lord <mattalord@gmail.com>

* gofmt file after accepting suggestion via GH PR

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

Signed-off-by: Matt Lord <mattalord@gmail.com>
Co-authored-by: Andrew Mason <amason@hey.com>
2022-09-28 16:35:56 -04:00
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