* 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>
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>
* Update to latest GCS client.
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
* xtrabackup: Make sure all files are closed before writing MANIFEST.
We've observed a backup that was missing files, yet had a MANIFEST.
In the built-in backup engine, the contract was that the MANIFEST file
must not be written unless all files were confirmed to have been
uploaded successfully. In XtraBackup mode, we were not meeting this
contract because an error that occurred while closing a file would not
be noticed until after we had written the MANIFEST.
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>