This upgrades pgzip to include a
[fix](https://github.com/klauspost/pgzip/pull/33) to prevent negative
byte counts being returned from `pgzip.Write`, which cause panics in
`bufio`.
These panics manifest when using compressed xtrabackup backups as:
```
Error: <_Rendezvous of RPC that terminated with
(StatusCode.UNKNOWN, caught panic during Backup: bufio: writer returned negative count from Write)>
```
Signed-off-by: Andrew Mason <amason@slack-corp.com>
ListShardTablets. In case of an old master, we replace the timestamp
displayed with "defunct".
Also show MasterTermStartTime in output of "show vitess_tablets" from
vtgate.
Signed-off-by: deepthi <deepthi@planetscale.com>
* Added wrapper struct, modified usage
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Add go.mod
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Refactor dbconfigs and its calls
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Fix failing vstreamer test
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Fix copy and paste mistakes
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Made withCredentials a private function and refactored the calls
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Fix Tests
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Clean up code
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Extend DbConfigs and change method name
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Add Connect Method
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Pass Context as parameter
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Modify definition of DBConfigs
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Make Connect function part of the Connector definition
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
* Remove obselete functions
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
Giving Env paramaters for secrets, not just CLI.
Rename prefix to be storage_root i.a.w what we do for s3 and gcs
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
The mysql server uses buffered I/O. This works fine if the results
are streamed all at once. But if the streaming is intermitent, like
in the case of messages, the client may not get timely responses.
This new change flushes any unsent data if no other data is sent
within mysql_server_flush_delay (100ms).
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
There were code paths where vplayer had an open transaction on
its dbclient connection, which got accidentally continued by
the copier. This caused production issues with some users.
The specific use case that was observed is:
* vreplication performs catchup.
* While it's in the middle of an apply, the context is canceled.
* The copier has no work.
* vreplication is asked to resume from the last saved position.
* It replays the same statements already in the transaction.
* This leads to dup key errors.
This fix conservatively rolls back dbclient before exiting.
The dbclient itself skips rollback if it's not in a transaction.
This change leads to relieable rollbacks where needed. At the
same time, there are no spurious rollbacks if we didn't start
a transaction.
As safety, I've added an extra rollback in the vreplicator loop
just in case the underlying functions accidentally leave an
incomplete transaction open.
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
right now the show character set are hardcoded to be filtered with where statement.
since we don't really want to expand the results or forward the query to an underlying mysql because vitess only supports these 2 charsets.
closes#5584
* separate show charset vs show charset in parser
* changed the executor accordingly
* use where_expression_opt in parser, changed AST and executor accordingly
Signed-off-by: roni <herongrong2011@gmail.com>
Fixes#5752
DBClient was setting the connection to nil after close, which was
causing vreplication to panic because it defers a Rollback on all
connections. The safer thing is to close the connection, but not
set it to nil.
There's no test for DBClient, but I've manually verified that this
won't panic any more.
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>