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

756 Коммитов

Автор SHA1 Сообщение Дата
Andres Taylor 1a261b5ee4 Merge remote-tracking branch 'upstream/master' into jacques_5825
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-08-11 10:17:20 +02:00
Andres Taylor 20bfda5ab2 make sure to backtick db names properly
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-08-11 08:58:03 +02:00
deepthi f64c0af7fc replace more uses of slave with replica/replication
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-07-31 09:01:25 -07:00
Jacques Grove 62b09bacb7 Issue #5825; reflect SERVER_STATUS_IN_TRANS and SERVER_STATUS_AUTOCOMMIT
flags correctly for queries.

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2020-07-28 21:20:59 -07:00
Peter Farr 70f7273f39 Finally passing. Hallelujah.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-07-27 16:23:37 -07:00
Andres Taylor a4739514ee clean up code
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-07-24 13:00:42 +05:30
Deepthi Sigireddi e86a967671
Merge pull request #6408 from arindamnayak/pitr-2
Implemented PITR-2
2020-07-18 13:28:56 -07:00
Arindam Nayak ecf278b381 improved the comment and rearrange the tests
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-18 17:25:35 +05:30
Arindam Nayak eaf24547bf handle the case where upto snapshot time there is no binlog event
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-17 20:08:55 +05:30
Arindam Nayak c500654d40 Implemented suggestion in PR comments
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-16 20:11:59 +05:30
Sugu Sougoumarane 60322344fe
Merge pull request #6435 from planetscale/rn-schema-tracking-initial-schema
Schema tracking: initial schema insert
2020-07-15 21:08:14 -07:00
Arindam Nayak d24e79ea41 include changes for improving the error messages and comments, variable names
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-15 23:55:01 +05:30
Peter Farr ce8945056f
Demote Master Refactor (#6365)
* Added a MasterStatus() method and carried it through the entire gRPC
chain, similar to what we do for SlaveStatus(). Other WIP changes to be
updated after getting approval on the MasterStatus() parts.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Small fixes per review suggestions.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Descriptive comments added per review suggestions.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added unit tests and small fixes.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Refactored per review suggestion. Under new design, it's not possible to unit test anymore, since we don't have mock connections. Removed unit test because of this.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Fix very odd rebase issue I've never seen before, where rebase didn't show me conflicts in various files that it allowed to continue without fixing known conflicts.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added new MasterStatus return for DemoteMaster and carried it through the entire call chain.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Remove deprecated field everywhere we possibly can, and ensure compatibility for newer client interacting with older server.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Remove copying of XXX fields, per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-07-14 14:58:06 -07:00
Arindam Nayak 0317a79ddf Merge branch 'master' into pitr-2
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-14 11:09:11 +05:30
Sugu Sougoumarane b6c7ffcbd9
Merge pull request #6396 from planetscale/ss-ts1-state
tabletserver: improved state transitions with new stateManager
2020-07-13 19:03:26 -07:00
Rohit Nayak 648f93c6fe
Schema tracking: initial schema insert
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-07-12 17:37:23 +02:00
Sugu Sougoumarane 3efba4be08 vttablet: stateManager tests WIP
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-07-11 14:07:48 -07:00
Harshit Gangal 820c56e85d savepoint: use session to store savepoints and pass on beginExecute
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-07-09 11:50:09 +05:30
Peter Farr 9f2b0fd0b7
Tablet Manager: Add Option To Stop IO Thread Only (#6335)
* Added the option to StopReplicationAndGetStatus() to stop only the IO Thread, and passed it all the way down the call chain to MysqlDaemon, where we can now call a new method (implemented in all flavors) which stops only the io thread, if that's what was requested.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Oops

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Remove hook per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Adjusted stop slave io thread to pass in a ctx because it's a new function. Adjusted StopReplicationAndGetStatus so that it stops the slave before getting slave status. This will ensure that the relay log information is correct.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Add back in logic to bail if slave is already stopped.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* We have to patch these in because after calling stop slave there won't be a master host and master port anymore when we grab slave status. Instead we need to patch in positions so we retain master host and master port, otherwise set master will assume the tablet is the master because it has no master host and master port. In retrospect its probably a bad idea that we assume no master host and no master port means we've found the master (in set master).

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Refactored per offline discussions. We now return before and after slave status, so we are more explicit, and don't nest business logic into subfields of a hybrid struct.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Fix issues that cropped up after merge conflict

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Change way we get this state to also pull in the Connecting state. We are either running, or attempting to run. Either way we are not not running.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Changed references from slave to replica per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Embed StopReplicationStatus into StopReplicationAndGetStatusResponse and rename fields to make it clear.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Various fixes per review suggestions.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Lets try out issuing a stop no matter what and see what happens.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Adding back in bailouts. They are necessary.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Get rid of more slave references.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Changed stopIOThreadOnly to an enum so we can change the way in which we stop replication in the future.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Add a test to ensure that we can stop the io thread only.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Fix incorrect test methodology.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Used a generated enum from proto per convention for the stop replication mode.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Scrub more references of slave without obfuscating MySQL statements that are being called under the hood.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-07-08 14:01:17 -07:00
Peter Farr 7d818333cc Updated logic to use dedicated method calls rather than faking the connection.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-07-07 17:48:27 -07:00
Sugu Sougoumarane c43bab5d68
Merge pull request #6416 from planetscale/ds-lint-fixes
linter fixes, remove staticcheck hook because golangci-lint includes it
2020-07-06 18:35:44 -07:00
deepthi 1b86928162 linter fixes, remove staticcheck hook because golangci-lint includes it
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-07-06 17:23:15 -07:00
Sugu Sougoumarane 3754654f63 test: faster unit tests
The fakesqldb was waiting .25 seconds on every call to Close.
This speeds up the tabletserver test considerably.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-07-06 12:37:50 -07:00
Arindam Nayak d5bc7935db fix build issue
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-05 16:32:06 +05:30
Arindam Nayak ca96cbc4a8 Added mariadb last gtid impl
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-04 17:27:59 +05:30
Arindam Nayak 239ebb0a16 sync with vitess/master
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-07-04 16:17:35 +05:30
deepthi 1acb6e0ad7 rename and deprecate RPCs, rename vars and files
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-07-02 11:22:18 -07:00
akilan 1cc4907ddf fixing linter errors
Signed-off-by: akilan <as251@hw.ac.uk>
2020-07-01 05:58:16 +04:00
Arindam Nayak 6805b62189 added last method to gtid
Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-06-29 00:17:39 +05:30
akilan 5aa4709675 Handled ineffectual errors
Signed-off-by: akilan <as251@hw.ac.uk>
2020-06-23 23:03:24 +04:00
Deepthi Sigireddi aa909c5128
Merge pull request #6296 from vitessio/find-errant-gtids
Find Errant GTIDs
2020-06-17 11:56:30 -07:00
Peter Farr 703fe9bf37 Let's follow the same pattern here so the way that we throw out the master sid is consistent for both receiver and supplied SlaveStatus'
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-15 21:39:53 -07:00
Peter Farr e56a7c0b63 Check set for nil as well per review suggestion.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-15 20:42:11 -07:00
Peter Farr 1dd0f170d8 Just realized this was mutating our input. Fixed it to instead copy over to a new set rather than deleting master sid from existing set.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-15 18:25:15 -07:00
Peter Farr d315ef5127 Improve comment per review suggestions.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-15 18:13:52 -07:00
Peter Farr f1dc0b60b2 Added parsing of master uuid for MySQL flavor and wrote FindErrantGTIDs method on SlaveStatus. I think this belongs here because it's clear that we are referring to ErrantGTIDs of the receiver, and it gives us access to the MasterUUID when comparing relay log positions. Also added testing to verify correctness of new method.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-15 16:26:47 -07:00
Peter Farr 1c1cce0298 Added extra tests requested, and clarified a comment now that we no longer call the second stack s2, and instead just called it otherIntervals.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-15 13:44:36 -07:00
Sugu Sougoumarane 2bc5eac963
Merge pull request #6298 from luisfmcalado/prep-stmt-bind-variables
Fix prepared statements in column specs
2020-06-14 19:18:32 -07:00
Arindam Nayak 28df5988f9 PITR changes
- added ability to fetch the GTID from the restore time
- added ability to apply the binlogs till the above GTID

Signed-off-by: Arindam Nayak <arindam.nayak@outlook.com>
2020-06-14 20:39:41 +05:30
Peter Farr ec92f31349 Make Difference take and return concrete types, since it will only be used for Mysql56GTIDSet anyways.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-12 16:44:45 -07:00
Peter Farr 269689c87a Significant refactor to make code easier to follow, by defining the 6 possible combinations we might see when comparing two intervals. Expanded testing and filled out comments for clarity
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-12 16:37:27 -07:00
Peter Farr dbed330011 Completely refactored logic, and added multi-split test cases that pass.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-12 15:17:31 -07:00
Peter Farr fc586ef9cb Comment corrections.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-11 22:39:48 -07:00
Morgan Tocker ff3a33de5c Merge remote-tracking branch 'upstream/master' into fix-cmdline-flag-docs
Signed-off-by: Morgan Tocker <tocker@gmail.com>
2020-06-11 07:33:37 -06:00
Morgan Tocker bca8843abb Add additional flag fixes
Signed-off-by: Morgan Tocker <tocker@gmail.com>
2020-06-11 07:32:21 -06:00
Peter Farr bbb6148509 Clarifying comment.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-10 13:21:31 -07:00
Luis Calado 2c8bbcc173
shorter var statement
Signed-off-by: Luis Calado <luisfmcalado@gmail.com>
2020-06-10 19:29:47 +01:00
Luis Calado 63e2186ddb
Fix prepared statements in column specs
Signed-off-by: Luis Calado <luisfmcalado@gmail.com>
2020-06-10 18:39:55 +01:00
Peter Farr 807acd5960 Wrote a Difference method and added a unit test to check that it functions. Unfortunately the data structure of other GTIDSets does not allow for us to represent a proper diff for those flavors.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-10 00:20:25 -07:00
Sugu Sougoumarane 87db352b51
Merge pull request #6217 from vitessio/refactor/emergency-reparent
Add relay log position and file-based positions to SlaveStatus.
2020-06-08 19:37:39 -07:00
Peter Farr 221e5e6b1c Updated to using testing framework per review suggestion.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-08 17:05:21 -07:00
Peter Farr c7b2653c52 Fixed issue with mariadb flavor. It errors out if Gtid_Slave_Pos is absent.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-08 12:50:44 -07:00
Peter Farr 8fbf2a2dcd Broke out core logic for parsing flavor specific slave status into helper functions for easier unit testing. Added unit tests to enforce all invariants we expect, and check logic of retrieval for all new fields.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-08 11:29:40 -07:00
Sugu Sougoumarane e13de6f450
Merge pull request #6249 from planetscale/jacques_6240
Fix issue #6240.  PR #6130 did not take the header length offset into
2020-06-08 11:09:00 -07:00
Peter Farr b9a018c4c8 Re-check this out from master to avoid whitespace diffs.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-05 14:07:30 -07:00
Peter Farr 41b7bb027f Refactored tests so we still check that nil of concrete type works for contains, and fixed position at least zero because it was failing for a similar reason.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-03 16:57:08 -07:00
Peter Farr 852791b2c6 Updated test based on new requirement that we expect the inverse.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-03 12:35:47 -07:00
Peter Farr 66e10835f6 I discovered that 0 for bitSize actually means uint destination.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-02 22:03:34 -07:00
Peter Farr 6504220047 We can simply add FilePositiona nd FileRelayLogPosition fetching to the common parseSlaveStatus function, and remove a lot of duplicate code for flavor specific logic. This commit also flips flavor_filepos to grab the FilePosition and FileRelayLogPosition acquired when parseSlaveStatus is run, and use those values for its fake GTID positions.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-02 21:44:16 -07:00
Peter Farr a93949e591 Fixed a very dumb mistake.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-02 21:16:57 -07:00
Peter Farr 27327d168c Comment clarity.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-02 21:15:26 -07:00
deepthi 25b4e4a385 fix flag docs to be more readable
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-06-02 17:42:29 -07:00
Peter Farr 89365a05ba Add doc comment explaining new requirement of Contains implementations.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 18:34:52 -07:00
Peter Farr bf119467bb Moved the atoi calls inside the if to clean up code. Updated error returns to use already allocated strings rather than hitting the map again. Only check if other is nil per review suggestion.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 18:33:18 -07:00
Peter Farr 031e3a39fc Per an offline discussion, we decided to push this logic down into contains, because fundamentally if either receiver or other are nil, then we can't accurately determine if one set contains another.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 12:36:57 -07:00
Peter Farr 7214d28e4c Fixed file position implementation. It should return false if other is not actually of filePosGTID type.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 12:25:55 -07:00
Peter Farr 5128401ce5 Add nil bailout in case either incoming GTIDSet is nil.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 12:23:22 -07:00
Peter Farr f82ab97802 Fix Contains implementations for all flavors. Most weren't correctly nil checking both the receiver and other GTIDSet.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 12:02:50 -07:00
Peter Farr 4912bde4be Copy these fields over so we don't leak flavor specific info into an abstract interface. Fixed map keys for all flavors per review suggestion, and other various fixes per review suggestions.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-06-01 11:26:55 -07:00
Andres Taylor 79e068d819 Merge remote-tracking branch 'upstream/master' into ds-replica-transaction
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-05-31 09:35:32 +02:00
Jacques Grove 28b13379c3 Fix issue #6240. PR #6130 did not take the header length offset into
account in writeBinaryRow().  Not an ideal fix, but something cleaner
will involve invasive cleanup.

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2020-05-30 17:06:23 -07:00
Andres Taylor be11233cae Make tx_engine use read only transactions when in replica mode
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-05-28 10:19:18 +02:00
Sugu Sougoumarane 734ed78e52
Merge pull request #6215 from inexplicable/tlsconfig
SIGHUP support for tls config update
2020-05-27 19:55:13 -07:00
Peter Farr 5c94c9b841 Added a Comparable method which returns whether one position is comparable with another position. Also added an AllPositionsComparable function that takes a list of positions and returns true if all positions are comparable with one another.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-05-26 21:03:04 -07:00
Andres Taylor ce8d72d347 Uncommented tests
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-05-25 10:10:21 +05:30
Peter Farr e94f3a692f Added a field for getting relay log position to Status. Implemented mapping this for all flavors, and updated proto so this gets mapped to the proto type. Added fields for getting file position and file relay log position to support looking at relay logs for flavors that dont support getting the retrieved GTIDSet.
Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-05-22 17:34:41 -07:00
huiqing 6496d15094 SIGHUP for tls config update
Signed-off-by: huiqing <hzhou@pinterest.com>
2020-05-22 11:01:25 -07:00
Deepthi Sigireddi eb211754f9
Merge pull request #6184 from planetscale/mariadb-gtid-set
go/mysql: Fix MariadbGTIDSet multi-domain support.
2020-05-15 10:43:36 -07:00
Anthony Yeh dc27fda151
go/mysql: Fix flaky TestConnectTimeout. (#6188)
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2020-05-15 10:41:04 -07:00
Anthony Yeh aa865ea1c1 go/mysql: Fix MariadbGTIDSet multi-domain support.
This fixes two bugs:

1. AddGTID was mutating the original set. GTIDSet implementations are
supposed to be immutable.

2. AddGTID and parseMariadbGTIDSet did not enforce any order among
domains, yet Equal and other functions expected order to be enforced.

This switches from a list to a map to better represent the fact that the
order of domains doesn't matter, which also simplifies some code.
We always enforce order when serializing back to a string.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2020-05-15 09:37:52 -07:00
Anthony Yeh 1c81ac2636 go/mysql: Fix TLS test for Go 1.13+.
The default TLS version changed, so we need to check the appropriate
counter.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2020-05-14 19:17:38 -07:00
Peter Farr 17dd6c60d8
GTIDSet Union (#6180)
* Corrected comment type.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added Union to the GTIDSet interface

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Wrote Union implementations for all current implementors of GTIDSet interface.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* We need to check if stacks are empty before making comparisons.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added unit tests for mysql56 and mariadb implementations.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Multiple fixes per review suggestions.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added helper method for popping intervals so this logic doesn't need to live inside the while loop itself.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Multiple fixes.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added test to ensure that return from Union is sorted by domain correctly. Also ran formatting.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* We don't need to explicitely non-allocate the second assignment.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Let this panic because supplying nil inputs is an invalid function call.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Comment update per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Add check for receiver being nil but other being non-nil, in case of union always return non-nil set.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2020-05-14 14:31:08 -07:00
Harshit Gangal d90138eeec return unknown db message on mysql connect to vtgate
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-05-07 21:55:02 +05:30
Harshit Gangal f65943bd7b remove cominitdb call with comquery with use statement
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-05-07 19:54:20 +05:30
Harshit Gangal 8905ac0bbd send use statement to vtgate instead of cominitdb method
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-05-07 19:30:26 +05:30
Keyur Govande da9cfe06cb Reduce the number of packets sent from vttablet to MySQL when
using TCP by creating the write buffers with pre-allocated space
for the header.

Signed-off-by: Keyur Govande <keyur_govande@yahoo.com>
2020-04-29 01:02:09 -04:00
Andres Taylor cc4f257a7e
Merge pull request #6042 from planetscale/sa-expression-evalution
VTGate Expression Evaluation
2020-04-17 14:25:44 +02:00
Saif Alharthi d391f0a354 Move evaluation expression to its own package
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2020-04-16 21:32:40 -07:00
Sugu Sougoumarane 1a38850cdc mysql: push conn timeout handling into mysql
Since the parameter is in mysql's conn params, that's the right
place to handle this.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-04-13 16:48:39 -07:00
Rafael Chacon 8cc5f430c3 Improves error codes
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2020-04-06 12:00:59 -07:00
Sugu Sougoumarane b72fb5d0ad
Merge pull request #5949 from planetscale/vrepl-filter
Filtered Vreplication: support int and varbinary filters for columns
2020-03-26 17:10:20 -07:00
Saif Alharthi 19ba263158 Fix prepared statements results parsing for signed values
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2020-03-25 15:05:40 -07:00
Rohit Nayak fd3374a538
Also treat binary/blob types as varbinary, gofmt-ed ...
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-03-24 21:56:04 +01:00
Rohit Nayak a8ce1a0ba0
Also treat binary/blob types as varbinary
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-03-24 21:54:07 +01:00
Rohit Nayak e5642dc20a
varchar type can have only varchar or varbinary column types
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-03-24 20:24:24 +01:00
Rohit Nayak 7a3b317ac8
Merge branch 'master' into vrepl-filter 2020-03-24 00:11:09 +01:00
Rohit Nayak 1457bd9496
Removed extraneous log
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-03-23 23:34:46 +01:00
Rohit Nayak 9445b2880f
Only use styp if not null
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-03-23 23:34:46 +01:00
Rohit Nayak cdded8887c
Handle varbinary correctly
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-03-23 23:34:46 +01:00
Sugu Sougoumarane ac251455a4 schema: fix integration tests
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-22 16:43:41 -07:00
Sugu Sougoumarane de34e694bf schema: other unit tests passing
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-22 16:43:41 -07:00
Sugu Sougoumarane 6d4cc87d7d schema: schema tests working
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-22 16:43:41 -07:00
Sugu Sougoumarane 1754e6f596 schema: simplification WIP
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-22 16:43:41 -07:00
Sugu Sougoumarane 6fab6f4fc1 schema: Columns to Fields
This gets rid of the per-table describe call.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-22 16:43:41 -07:00
Sugu Sougoumarane 77911a20fd schema: deprecate table stats
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-22 16:43:41 -07:00
Sugu Sougoumarane a4e107d0a5 deprecation: tabletserver tests WIP
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-17 17:53:50 -07:00
Jacques Grove 32146f0c6a Merge branch 'master' of github.com:planetscale/vitess
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2020-03-06 16:40:24 -08:00
Jacques Grove a9bed09340 Do not drop leading zeroes in microsecond timestamps for prepared
statements.  Fixes #5900

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2020-03-06 16:38:56 -08:00
Sugu Sougoumarane 124cc4399b
DBConfigs Refactor (#5833)
* 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>
2020-03-05 08:31:25 -08:00
Sugu Sougoumarane cd0191913c
Merge pull request #5832 from adsr/db-conn-timeout
Add `-db_connect_timeout_ms` for timing out mysqld conns.
2020-03-04 21:03:41 -08:00
Rafael Chacon f0797e741b
Merge pull request #5881 from tinyspeck/sp-log-conn-accept-err
Log when we fail to accept a conn
2020-03-02 16:30:18 -08:00
Serry Park de0e7c4733 Log when we fail to accept a conn
Signed-off-by: Serry Park <me@serry.co>
2020-03-02 15:38:35 -08:00
Deepthi Sigireddi 2abd04fed8
Merge pull request #5874 from abursavich/patch-1
Remove allocation of unused bytes
2020-03-02 14:10:35 -08:00
Sugu Sougoumarane 8383470c15 mysql: flush buffer on inactivity
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>
2020-03-01 20:49:18 -08:00
Andy Bursavich 4bf6010876 mysql: remove allocation of unused bytes
Signed-off-by: Andy Bursavich <abursavich@gmail.com>
2020-02-28 16:07:05 -08:00
Adam Saponara e8b87f9469 Add `-db_connect_timeout_ms` for timing out mysqld conns.
While testing vttablet-mysqld over TCP, we noticed mysql.Connect
sometimes blocks forever if the backend mysqld hit max conns. This
patch adds a timeout to this codepath. It defaults to 0 (no timeout)
for back compatibility.

Signed-off-by: Adam Saponara <as@php.net>
2020-02-24 11:56:57 -05:00
Jacques Grove fdc3c6e738 Address #5734 by forming MySQL error packet on query parse error during
COM_PREPARE

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2020-01-17 17:08:33 -08:00
Rafael Chacon 61a8ed44a1 Updates how master gtid position is obtained for file:pos flavor
When generating masterGTIDSet in file:pos most likely you will have a topology
like the following:

  Source A -> Target B (B has a vreplication stream from A)

From the target perspective, the source A is the master and you want to generate
a gtid that is based on binlog file position of that server.

As an example, let's see this topology:

  Master A -> Source B -> Target C (C has vreplication stream from B)

Prior to this change, masterGTIDSet was returning the binlogfile:pos of A. But
in reality, the Target C wants the position of B.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2020-01-10 16:38:59 -08:00
Rafael Chacon 085b8702b3 Fixes bug in filepos flavor
* Prior to this commit, flavorpos was using lexicographical comparison of the gtids.
  Thas was a bug in this context.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2020-01-10 13:15:12 -08:00
Jacques Grove 4fc742e176 Add vttablet auth support for external Azure MySQL.
Azure ignores the mysql_native_password in
the MySQL Login Request packet, and then issues
a Auth Switch Request specifying the mysql_native_password
again, and passing a new salt.

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2020-01-09 23:00:42 -08:00
Toliver Jue 3df2fd9173 Fix order
Signed-off-by: Toliver Jue <toliver@planetscale.com>
2020-01-09 10:30:37 +01:00
Toliver Jue 01950c9450 Advertise support for FOUND ROWS from server
Signed-off-by: Toliver Jue <toliver@planetscale.com>
2020-01-09 10:04:48 +01:00
Deepthi Sigireddi cafd1094ef
Merge branch 'master' into mysql-replication-bugfix 2020-01-03 10:53:22 -08:00
Ajeet jain 1836426f1e
removing unrequired statement based test as it is deprecated
Signed-off-by: Ajeet jain <ajeet@planetscale.com>
2020-01-02 10:30:15 +05:30
deepthi fa5d43ca2f setMasterLocked: RESET SLAVE if START SLAVE throws SQL error 1872
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-12-30 18:54:38 -08:00
Sugu Sougoumarane 9daae6d8c0 tests: fix unit_race
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-12-22 21:55:11 -08:00
Sugu Sougoumarane 92083793ac tests: fix various tests
Fixes #5532
Fixes #5569
Fixes #5571

With this fix, unit tests pass for all flavors.
Also fix test.go to cover the newer flavors.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-12-22 13:13:01 -08:00
deepthi ca800b388f fix unit tests
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-12-19 12:25:06 -08:00
Jacques Grove 175bb6592c Add proxy protocol support for vtgate.
Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2019-12-19 12:25:06 -08:00
Morgan Tocker e6a7e4abba Add additional flavors, move flaky test
Signed-off-by: Morgan Tocker <tocker@gmail.com>
2019-12-13 12:53:10 -07:00
Saif Alharthi 93e0b213d3 Fix prepared statment buffer overwriting bug
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-12-12 15:39:47 -08:00
Rafael Chacon dc0f4a3a5d Merge branch 'master' of https://github.com/vitessio/vitess into vtshovel-poc 2019-12-04 14:56:00 -08:00
Morgan Tocker 399f23accc Merge remote-tracking branch 'upstream/master' into morgo-semi-sync-optional
Signed-off-by: Morgan Tocker <tocker@gmail.com>
2019-12-01 09:11:18 -07:00
Morgan Tocker dc34efab5b Merge remote-tracking branch 'upstream/master' into morgo-semi-sync-optional
Signed-off-by: Morgan Tocker <tocker@gmail.com>
2019-12-01 09:10:19 -07:00
Rafael Chacon 69a4dd0af6 Merge branch 'master' of https://github.com/vitessio/vitess into vtshovel-poc 2019-11-27 16:19:31 -08:00
Rafael Chacon b1a8772d8e Fixes bug in filepos and adds test for statement mode
* StripChecksum was changing the type of the event. This was a bug.
* Adds test to vstreamer to reflect new support for statement based replication

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-11-27 16:08:04 -08:00
Morgan Tocker 3abebd8f3a Make semi sync extension optional
Signed-off-by: Morgan Tocker <tocker@gmail.com>
2019-11-27 13:26:41 -07:00
Morgan Tocker 3720fea3e0 Update MySQL Server Version to 5.7
Fixes #4119

Signed-off-by: Morgan Tocker <tocker@gmail.com>
2019-11-27 09:50:12 -07:00
Jacques Grove 5d5e150858 Fix vtexplain race by waiting around for the fakesqldb tabletserver
instances to exit cleanly.  Fixes #5474

Signed-off-by: Jacques Grove <aquarapid@gmail.com>
2019-11-26 18:15:26 -08:00
Rafael Chacon 166570176d Fixes per rebase with file:pos feature
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-11-26 10:23:52 -08:00
Rafael Chacon 6593e5df30 Merge branch 'upstream-master' into vtshovel-poc 2019-11-22 17:09:45 -08:00
Rafael Chacon 848f82b493
Merge pull request #5432 from planetscale/ss-filepos
vreplication: file:pos flavor
2019-11-22 16:39:05 -08:00
Peter Farr f7205b8a67 Bug Fix: Prepared Statements Bind Variables Nil Error (#5441)
* Fixed nil bind variables error by resetting bindvars to an empty map.  Also added a recover to catch panics that occur inside Logf due to FormatBindVariables call potentially panicking.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Changed import order back.  Order was auto-changed by IDE on save

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Using stored ParamsCount for capacity per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Added explanation comment per review suggestion.

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>

* Removed explicit panic after offline talk with sougou and deepthi

Signed-off-by: Peter Farr <Peter@PrismaPhonic.com>
2019-11-22 15:47:17 -08:00
Sugu Sougoumarane f0763d7cf4 vrepl: tests for filePos flavor
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-12 22:23:40 -08:00
Sugu Sougoumarane b5fdcecf01 mysql: standardize how GTID is sent
The vstreamer sent GTIDs "as they came". With the new change,
GTIDs are sent only when they matter: on COMMIT, DDL or OTHER.

This new approach makes the protocol easier to understand. Also,
it makes it easier for filePos to continuously send file and position.
The correct values will get used when significant events like
COMMIT are encountered.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-11 21:54:46 -08:00
Sugu Sougoumarane 550f702c48 mysql: make filePos handle transactions
In this scheme, the filePos reader detects whether we are in a
transaction or not, and emits appropriate GTID events.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-11 20:14:36 -08:00
Sugu Sougoumarane 30290b1719 mysql: conn params and flavor specific code
Add Flavor as a conn param.
Add code to handle flavor-specific GTID.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-11 20:14:36 -08:00
Sugu Sougoumarane 89350ee300 mysql: filepos initial pull from PS repo
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-11 20:14:36 -08:00
Rafael Chacon 4bd4904e83 Style improvements
* Fix typo in some comments.
* Make VReplicator private again. This change is no longer needed. Originally we
wanted "vtshovel" to be an external process. Given that this now hooks into the
existent engine, there is no need to make this public.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-11-06 13:46:27 -08:00
Sugu Sougoumarane 501862ade1 mysql: handle db name correctly
Fixes #5206

The conn schemaname var can get set through a new connection
or a ComInitDB packet. However, a use statement bypasses this
mechanism and gets handled at the vtgate level. This causes
problems because schemaName in the connection disagrees with
TargetString in vtgate.

To fix this, the new scheme calls a new handler function: ComInitDB
every time schemaName is initialized or changed in the connection.
This way, the TargetString remains the authoritative source
for the current db name.

I couldn't write a test for this specific behavior change because
the mysql go client does not implement support for ComInitDB.
But I've verified the things generally work as expected.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-03 02:37:19 -08:00
Sugu Sougoumarane f2567cf81e
Merge pull request #5331 from yuxiaobo96/vitess-license2
add license in /go file
2019-10-23 21:49:44 -07:00
Morgan Tocker 0584291809 Remove SSLv3 Support
Fixes #5273

Signed-off-by: Morgan Tocker <tocker@gmail.com>
2019-10-21 09:13:05 -06:00
yuxiaobo 03e83d6c30 add license in /go file
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-10-21 22:30:02 +08:00
Rafael Chacon c3c238b909 Adds the core of vtshovel program
* Adds binary to run vtshovel.
* At the moment only working in ephemeral mode (i.e no data is persisted back to
  vrsettings).
* vtshovel only works for statement based replication right now. This is due to
  now having a good way to have a schema loader. We will itereate on this.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-10-11 14:50:33 -07:00
tanjunchen 63c969ca7d add License in /go files
Signed-off-by: tanjunchen <2799194073@qq.com>
2019-10-12 00:31:28 +08:00
Rafael Chacon 2f1d3b1ec8 Adds BinlogFilePos as a way to encode mysql replication
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-10-10 11:44:46 -07:00
Rafael Chacon 11301e3d65 Adds support for file:pos in mysql binlogdump interface
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-10-10 11:41:14 -07:00
Sugu Sougoumarane 7c72f47da8
Merge pull request #5242 from hwdef/fix-typo1
fix some spelling mistakes
2019-09-27 06:46:38 -07:00
yuxiaobo e47d73a6d9 Improve the quality of the documents
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-09-27 16:03:33 +08:00
hwdef 28abeb0985 fix some spelling mistakes
Signed-off-by: hwdef <hwdef97@gmail.com>
2019-09-27 11:15:31 +08:00
Sugu Sougoumarane bd0806eac9
Merge pull request #5219 from planetscale/sa-5201
Add support for COM_RESET_CONNECTION
2019-09-26 13:57:07 -07:00
Sugu Sougoumarane 4b54065e2a
Merge pull request #5233 from drogart/drogart-change-bad-handshake-logging-to-info
Change bad client handshake logging from err to info.
2019-09-26 10:07:26 -07:00
Dan Rogart 79de265060 fixing formatting so s/spaces/tabs/. go lang newbie here!
Signed-off-by: Dan Rogart <drogart@github.com>
2019-09-26 09:48:31 -06:00
Dan Rogart 411c59fa81 Change bad client handshake logging from err to info. This brings the logging behavior in line with recent mysql versions.
Signed-off-by: Dan Rogart <drogart@github.com>
2019-09-26 09:34:47 -06:00
hwdef 1f98c92b79 fix some spelling mistakes
Signed-off-by: hwdef <hwdef97@gmail.com>
2019-09-26 17:06:20 +08:00
Saif Alharthi 52b3b7763c Add support for connection reset in vtgate
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-09-25 21:28:55 -07:00
deepthi 91e4977e0d fix unit_race failures
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-09-12 21:28:21 -07:00
Adam Saponara 7504082368 Handle case where mysqld replies to Initial Handshake Packet with an ERR packet.
From mysql docs:

```
It starts with the client connect()ing to the server which may send a
ERR packet and finish the handshake or send a Initial Handshake
Packet...
```

`sql_state` fields are skipped because they are not set according to docs.

```
Note
In case the server sent a ERR packet as first packet it will happen
before the client and server negotiated any capabilities. Therefore
the ERR packet will not contain the SQL-state.
```

Signed-off-by: Adam Saponara <as@php.net>
2019-08-29 18:35:05 -04:00
hwdef 51ba11f52f fix spelling mistake
Signed-off-by: hwdef <hwdef97@gmail.com>
2019-08-23 13:33:42 +08:00
Guangming Wang 175cf95ec9
cleanup: fix typos in mysql/client.go
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-17 23:27:07 +08:00
Saif Alharthi 5533c2212e Address comment
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-14 16:20:22 -07:00
Saif Alharthi bfa8482c1e Quick fix
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-14 13:00:59 -07:00
Saif Alharthi 53310a35e1 Address staticcheck warnings in prepared statement
Merged prepared statement code changes did not take into account
staticcheck warnings. This PR addresses those warnings.

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-14 09:29:54 -07:00
Saif Alharthi d90e723373 Address comments
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-08 23:02:53 -07:00
Saif Alharthi 58a810f823 Fixed tests and bug in ComPrepare
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-08 22:05:45 -07:00
Saif Alharthi 3dc1bf5ceb Merge remote-tracking branch 'origin/master' into tiglabs-prepare
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-07 10:01:15 -07:00
Saif Alharthi 0fedf79990 Fix Tests
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-08-07 09:53:30 -07:00
Alex Charis eb9f8a0d88 add a testcase to binlog_event_json_test
Signed-off-by: Alex Charis <acharis@hubspot.com>
2019-08-05 20:59:02 -04:00
Saif Alharthi a138a405df Merge remote-tracking branch 'origin/master' into tiglabs-prepare
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-31 21:26:53 -07:00
deepthi c936f1a9dc add unit tests for 1-byte, 2-byte and 3-byte json string lengths
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-07-30 12:34:09 -07:00
Saif Alharthi 017cf57f88 Quick fix
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-30 12:21:18 -07:00
Saif Alharthi 5eb5830783 Addressed partial comments
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-30 11:24:02 -07:00
deepthi ca871d3443 also add a link to mysql server 8.0 implementation
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-07-30 08:48:18 -07:00
deepthi fed4d0e034 change function name to be more descriptive, add link to mysql source and comments
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-07-30 08:41:20 -07:00
Alex Charis c6bd993274 fix readVariableInt; add test
Signed-off-by: Alex Charis <acharis@hubspot.com>
2019-07-29 23:33:40 -04:00
Saif Alharthi 6a01fe09aa Replaced etcd2 with zk for end to end tests
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-24 11:53:40 -07:00
Saif Alharthi 85a4f18552 Updated TestComPrepare test
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-24 09:43:53 -07:00
Saif Alharthi c55be518ec Added dependency to bootstrap.sh and edited python test
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-23 15:50:46 -07:00
Saif Alharthi ed69725078 Added mysql-connector dependency
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-23 12:06:59 -07:00
Saif Alharthi bc1ac07b77 Added test for TestComStmtExecute
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-22 11:53:37 -07:00
Saif Alharthi 698243b3d0 Added python end to end test
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-19 17:29:11 -07:00
Saif Alharthi 96ed068636 added few more tests in query_test
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-15 15:29:28 -07:00
Saif Alharthi 8d641ee0fb Added test for ComPrepare
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-07-15 10:23:56 -07:00
Saif Alharthi 9ceb1f4d33 Merge remote-tracking branch 'origin/master' into tiglabs-prepare
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-06-30 15:45:43 -07:00
Saif Alharthi 24ea99faf0 Merge remote-tracking branch 'origin/master' into tiglabs-prepare
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-06-28 14:51:50 -07:00
Dan Kozlowski 8200553641 Merge branch 'master' of github.com:vitessio/vitess into dk-backup-only
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
2019-06-19 23:08:32 -07:00
Daniel Kozlowski 884d789877
Merge pull request #4502 from HubSpot/mysql-protocol-client-cert
add support for client cert auth for mysql protocol vtgate connections
2019-06-20 00:40:07 +02:00
deepthi ed0079038b Merge branch 'prepare' of git://github.com/tiglabs/vitess into tiglabs-prepare
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-06-17 09:54:53 -07:00
kuba-- 43acd7b29b
Don't return an error for CONN_ATTR (just log)
Signed-off-by: kuba-- <kuba@sourced.tech>
2019-06-01 00:19:32 +02:00
Sugu Sougoumarane d40c197b94
Merge pull request #4793 from planetscale/dk-dns-reload
Add in option to re-resolve DNS names
2019-04-29 17:31:16 -07:00
Sugu Sougoumarane 5067333141
Merge pull request #4797 from planetscale/sa_reload_credentials
Rotate credentials for vtgate.
2019-04-28 20:45:45 -07:00
Saif Alharthi 9ca18d5390 close goroutine
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-04-24 10:30:30 -07:00
Saif Alharthi 93b1e462ba Modified test to stop ticker
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-04-22 16:19:06 -07:00
Saif Alharthi e7e8aea8eb Fixed format and restore global value
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-04-17 10:23:58 -07:00
Saif Alharthi 313a3247d3 Fixed test
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-04-16 20:02:46 -07:00
Dan Kozlowski 6f2e405bbb Add in option to re-resolve DNS names
This adds in the ability to re-resolve DNS names used in a connection
of an external database. The default is to do nothing new. A new
command line options `pool_hostname_update_rate` has been added that
will resolve the hostnames used in each pool at the given rate and
will force a reconnect if they have changed

Signed-off-by: Dan Kozlowski <koz@planetscale.com>
2019-04-16 15:51:28 -07:00
Saif Alharthi a440e0e37e Increased sleep time
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-04-16 14:15:28 -07:00
Saif Alharthi def7952d6b Added the ability to reload credentials for vtgate.
Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
2019-04-16 13:08:26 -07:00
xichengliudui 864727675f Using const() defines constants together
Signed-off-by: xichengliudui <liuduidui@beyondcent.com>
2019-04-10 17:01:11 -04:00
tpetr 19b7a38c35 forgot some stuff
Signed-off-by: tpetr <tpetr@hubspot.com>
2019-04-02 12:15:22 -04:00
tpetr 2d19dccae1 PR feedback + add tests + light refactoring
Signed-off-by: tpetr <tpetr@hubspot.com>
2019-04-02 11:03:32 -04:00
dcadevil 2393ff7687
Merge branch 'master' into prepare 2019-04-01 16:03:46 +08:00
deepthi b9acd8699d fixes from review
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-03-12 13:30:10 -07:00
deepthi 86474bbd59 staticcheck: packages/files missed during first pass
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-03-07 11:51:31 -08:00
deepthi a008747718 staticcheck: unit test for readVariableInt bugfix
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-03-07 11:45:27 -08:00
deepthi 7e3c96edb0 staticcheck: mysql package
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-03-07 11:12:47 -08:00
Michael Hebelka 075666ba02 Strictly check the structure of mysql static auth json config
Signed-off-by: Michael Hebelka <michael.hebelka@sharpspring.com>
2019-03-06 14:55:43 -05:00
Deepthi Sigireddi 6585831f8f
Merge pull request #4556 from systay/errors
Use vterrors to store stack traces
2019-03-02 18:36:24 -08:00
Sugu Sougoumarane 0a5c74cfac
Merge pull request #4693 from JoeWrightss/patch-3
Fix some misspells in comment
2019-02-28 12:07:24 -08:00
zhoulin xie 1a7ee9ca90 Fix some misspells in comment
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-28 18:14:20 +08:00
Sugu Sougoumarane 0034a99d6d InitShardMaster: make it more idempotent
If ISM is retried, it's possible it gets stuck. The specific use
case where this happens is when the first attempt went past the
point where semi-sync gets enabled. If we retry ISM after that,
the part where we create the reparent journal table will hang
because the master will have semi-sync enabled, but no replica
will be pointing to it.

To overcome this, we always disable semi-sync when resetting
replication. All the code that enables replication turns semi
sync on as needed already.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-02-27 15:02:41 -08:00
Andres Taylor c6cae699f0 Use vterrors in the mysql package
Signed-off-by: Andres Taylor <antaylor@squareup.com>
2019-02-27 15:06:44 +01:00
xichengliudui 30c8a93abb Use the import () way
Signed-off-by: xichengliudui <liuduidui@beyondcent.com>
2019-02-12 13:53:16 -05:00
tpetr 28d8542446 ensure that -mysql_server_ssl_ca is set when using the cliencert auth plugin
Signed-off-by: tpetr <tpetr@hubspot.com>
2019-02-04 14:24:23 -05:00
Sugu Sougoumarane 207b084ca8
Merge pull request #4555 from planetscale/ss-vrepl
vreplication: vplayer
2019-01-30 19:21:24 -08:00
xichengliudui c68ed2dc09 Update the function name in the comment
Signed-off-by: xichengliudui <liuduidui@beyondcent.com>
2019-01-30 03:16:57 -05:00
Iskander (Alex) Sharipov dbc94c0c5a
go/mysql: remove excessive []byte(s) conversion
`copy` permits using to mix `[]byte` and `string` arguments without
explicit conversion. I removed explicit conversion to make code simpler.

Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
2019-01-29 00:42:11 +03:00
Sugu Sougoumarane d74e120530 vplayer: fix for binary column data type
Fixes #3984

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-26 17:48:45 -08:00
Simon J Mudd ade04fe766 Change common unhandled packet error message to clarify origin
Signed-off-by: Simon J Mudd <sjmudd@pobox.com>
2019-01-24 19:08:05 +01:00
Andres Taylor be97d690eb Add capability create consistent transactions
To make this possible, some things are added:
 - The capability to lock all tables on a tablet, to momenterily stop updates
 - Once the database is locked, we can create multiple consistent snapshot
   transactions that all share the same view of the data
 - Adds the capability to have replication move forward to a specific point
   in the transaction log

This commit also refactors tabletserver and tx_engine, moving logic of
state transitions into the tx engine.

Signed-off-by: Andres Taylor <antaylor@squareup.com>
2019-01-18 16:26:25 +01:00
dcadevil 24d0dd0272 add comments
Signed-off-by: dcadevil <dcadevil@126.com>
2019-01-17 14:58:20 +08:00
dcadevil 85f6d74ecb add missing function implementation
Signed-off-by: dcadevil <dcadevil@126.com>
2019-01-16 14:00:45 +08:00
dcadevil 91f73b1066 support for the MySQL prepare command protocol
Signed-off-by: dcadevil <dcadevil@126.com>
2019-01-16 11:29:36 +08:00
dcadevil 30cda05138 support for the ComPrepare
Signed-off-by: dcadevil <dcadevil@126.com>
2019-01-15 18:49:03 +08:00
Alex Charis 0b0b841b53 inline ok check; while-range instead of bare while
Signed-off-by: Alex Charis <acharis@hubspot.com>
2019-01-14 17:15:10 -05:00
tpetr a5304daa02 add support for client cert auth for mysql protocol connections
Signed-off-by: tpetr <tpetr@hubspot.com>
2019-01-07 13:02:14 -05:00
Michael Hebelka 5be6e2a20d Add a StaticUserData test and update json parsing test
Signed-off-by: Michael Hebelka <michael.hebelka@sharpspring.com>
2019-01-03 17:02:13 -05:00
Michael Hebelka de9dd9c168 Add group specification to mysql static auth for ACL usage
Signed-off-by: Michael Hebelka <michael.hebelka@sharpspring.com>
2019-01-03 14:32:05 -05:00
Sugu Sougoumarane a60a42d4c5 build: fix broken build for other flavors
There were a few regressions that got introduced due to
recent changes:
* MYSQL_FLAVOR got dropped from Dockerfile.mariadb.
* New build.env did not get included in the docker builds.
* CapabilityClientDeprecateEOF behaves differently for MySQL 5.7
  vs older versions: MySQL 5.6 and MariaDB. For 5.7, the capability
  always comes back true, but it comes back as true or false
  for other versions. So, I just removed the check.

Also removed column length check in one of the tests because
they are not consistent across flavors.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-12-31 13:26:16 -08:00
Sugu Sougoumarane 23f135ea6e
Merge pull request #4486 from dweitzman/multi_stmt
Multi-statement support
2018-12-22 11:18:51 -08:00
David Weitzman f1397ed998 Multi-statement support for the vtgate mysql protocol
This completes yuananf's work from https://github.com/vitessio/vitess/pull/3683
which was split into several diffs and never fully landed.

One large benefit of multi-statement support is that the "rewriteBatchedStatements"
option in Java's connector-j driver doesn't work without it. There's a bug where
connector-j fails to check the server capabilities and assumes multi-statement support.

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2018-12-22 10:07:10 -08:00
David Weitzman a33b3d6d98 Extract the connection com_query implementation into its own method
Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2018-12-22 09:54:13 -08:00
Michael Demmer b0c3523ee3 reformat using go 1.11 formatter
Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
2018-12-18 06:41:59 -08:00
Rafael Chacon ec5745a61d Silence some noisy log entries
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2018-12-05 17:00:25 -08:00
Rafael Chacon a52ace5ab8 This log entry is too verbose and it will spam server logs
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2018-12-03 16:23:42 -08:00
Daniël van Eeden 58a49106d3 Add testing for connection attribute parsing
Signed-off-by: Daniël van Eeden <git@myname.nl>
2018-11-18 11:49:31 +01:00
Daniël van Eeden fa42f53178 Decode Connection Attributes
Signed-off-by: Daniël van Eeden <git@myname.nl>
2018-11-16 15:14:15 +01:00
Daniël van Eeden 9152e79653 Allow the client to send connection attributes
By setting CapabilityClientConnAttr in the ServerGreeting the client
starts to send key/value pairs in the login packet.
The keys vary per client but often include client pid, client version
client program, driver version, user on the client

Signed-off-by: Daniël van Eeden <git@myname.nl>
2018-11-16 13:15:11 +01:00
Sugu Sougoumarane a1fa3ea25a
Merge pull request #4368 from planetscale/ds-mysql-password
Fix bug in mysql static authentication
2018-11-15 15:40:12 -08:00
Sugu Sougoumarane d7b14ade4a
Merge pull request #4360 from Santiclause/mariadb-gtidset
Support multiple GTIDs in MariaDB GTIDSets
2018-11-15 15:05:30 -08:00