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

674 Коммитов

Автор SHA1 Сообщение Дата
Alex Charis 6632d48cc0 allow sql_mode or json_mode on the server-side
Signed-off-by: Alex Charis <alex.charis@shopify.com>
2021-06-04 13:22:07 +00:00
Alex Charis 7ce57def92 added command line interface
Signed-off-by: Alex Charis <alex.charis@shopify.com>
2021-06-04 13:22:07 +00:00
Alex Charis 335e880c8e added skip_rebuild and v_schema to message types
keyspace existence check, and return updated vschema, handle skip_rebuild

Signed-off-by: Alex Charis <alex.charis@shopify.com>
2021-06-04 13:22:07 +00:00
Alex Charis cb21654896 implement ApplyVSchema in grpc-vtctld
Signed-off-by: Alex Charis <alex.charis@shopify.com>
2021-06-04 13:22:07 +00:00
Andres Taylor f26d7000c3
Merge pull request #8211 from planetscale/vtgate-prepare
VTGate grpc implementation of Prepare and CloseSession
2021-06-02 09:27:05 +02:00
Andrew Mason f028324c3e Add `{Apply,Get}RoutingRules`, `RebuildVSchemaGraph` rpcs to VtctldServer and run generators
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-06-01 16:39:42 -04:00
Andrew Mason 2a92daecbf
Merge pull request #8219 from tinyspeck/am_cell_rw_rpcs
[vtctldserver] Migrate `CellInfo`, `CellAlias` rw RPCs
2021-06-01 16:14:51 -04:00
Sara Bee aed2349c7e [vtadmin-api] Add HTTP endpoints for /api/srvvschemas and /api/srvvschema/{cluster}/{cell}
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-06-01 07:16:27 -04:00
Andrew Mason 1a9acaaa8a Add protos for CellInfo+CellsAlias RW rpcs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-05-31 21:24:21 -04:00
Sara Bee fa498b4419 [vtctld] Add GetSrvVSchemas command
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-05-31 15:13:44 -04:00
Harshit Gangal 0223eb01b9 proto changes for prepare and closeSession vtgate api
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2021-05-31 13:05:02 +05:30
Sara Bee d1899be612 [vtadmin-api] Update GetTablet to use alias instead of hostname
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-05-20 14:16:54 -04:00
Andrew Mason c81ad52751 [vtadmin] Add GetKeyspace rpc, regenerate protos
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-05-14 11:56:41 -04:00
Andres Taylor ce022a0594 Merge remote-tracking branch 'upstream/master' into schema-fetch
Signed-off-by: Andres Taylor <andres@planetscale.com>
2021-05-05 07:24:20 +02:00
Harshit Gangal 67dcf8e73a proto changed to send table name having changed schema
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2021-04-30 19:52:34 +05:30
Andrew Mason ab54272186
[vtadmin] gate/tablet/vtctld FQDNs (#7886)
* Add FQDN fields to tablets/gates/vtctlds

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Add discovery-consul options for gate/vtctld FQDN tmpls

staticfile disco doesn't need this, because it can just read this from
the config. **Note**: the main downside is that the json key is "FQDN"
rather than "fqdn" which 🤷 ?

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Add FQDN impls to gates/vtctld for consul-disco

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Propagate FQDN field through the api

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Move per-cluster gate fetching to .... the cluster struct

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* nit: cleanup double imports

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Extract repeated template=>buffer execution to a textutil function

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Add fqdn template support to clusters and `parseTablet`

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* fix typo (ugh)

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Ensure `New` parses the final tablet fqdn tmpl off the config

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Fix typos, update comments

Signed-off-by: Andrew Mason <amason@slack-corp.com>

* Cleanup TODOs

Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-04-29 11:30:31 -04:00
Shlomi Noach 4bb1ee7d6f
Online DDL plan via Send; "singleton" migrations on tablets (#7785)
OnlineDDL via Send
2021-04-22 14:58:26 +03:00
Sara Bee 4bc2428196 Reintroduce include_non_serving_shards opt to GetSchema
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-04-09 10:46:25 -04:00
Rafael Chacon b6a8acbad8
Merge pull request #7751 from tinyspeck/am_vtadmin_aggregate_schema_sizes
[vtadmin] Aggregate schema sizes
2021-03-31 08:57:21 -07:00
Andrew Mason 9d5a725bd1 Remove IncludeNonServingShards from TableSizeOptions
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-28 10:18:22 -04:00
Rohit Nayak 1f108c1302
Merge pull request #7626 from planetscale/rn_vstream_skew
VStream API: allow aligning streams from different shards to minimize skews across the streams
2021-03-26 08:18:27 +01:00
Rohit Nayak 8f39f90d34
VStream Skew: update vstream client api to accept flags
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2021-03-23 11:31:06 +01:00
Andrew Mason 78a8ff4727 Fix typo in protobuf comment
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-19 18:31:21 -04:00
Andrew Mason a87a5a4032 Add TabletAliases param to GetTabletsRequest
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-18 20:31:33 -04:00
Andrew Mason f26f2822f9 Update GetTabletRequest to include strict flag and regenerate
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-18 08:25:31 -04:00
Deepthi Sigireddi f8d0d0a9e6
Merge pull request #7690 from tinyspeck/am_vtctld_shard_replication_positions
[vtctld] Migrate ShardReplicationPositions
2021-03-17 18:29:43 -07:00
Rohit Nayak deaf8180e7
Merge pull request #7662 from tinyspeck/am_vtadmin_getworkflows
[vtadmin] GetWorkflow(s) endpoints
2021-03-16 15:27:06 +01:00
Andrew Mason 8c11584ba5 Add TabletMap to proto response to support tablet sorting in CLI
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-15 18:45:02 -04:00
Andrew Mason 3c8dfe3620 Add RPC for ShardReplicationPositions, generate and add method stub
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-15 18:45:02 -04:00
Andrew Mason 51a640ee53 Add GetSrvKeyspaces rpc, run generators and add method stub
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-14 11:35:29 -04:00
Andrew Mason 8fd5d51122 WIP: change protos to uint64
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-13 10:07:36 -05:00
Andrew Mason b09ab1d523 WIP: first pass and adding sizes to protobufs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-13 08:14:39 -05:00
Andrew Mason 2f54aa6e84 Update proto types to include warnings in workflow aggregations
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-12 08:02:12 -05:00
Andrew Mason ff5531eb80 Add `keyspace` field to protos
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-10 19:44:22 -05:00
Andrew Mason b001075870 Add workflow rpcs, generate types, add stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-09 22:07:00 -05:00
Andrew Mason b85a468ca1 Add GetVSchema(s) rpcs, run generators, add stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-06 16:20:32 -05:00
Rohit Nayak 2b18baa246
Merge pull request #7610 from tinyspeck/am_vtadmin_find_schema
[vtadmin] Add FindSchema route
2021-03-06 10:05:26 +01:00
Rohit Nayak 7a5e4fed56
Merge pull request #7575 from tinyspeck/am_vtctld_workflows
[vtctld] Add v0 GetWorkflows rpc and workflow/vexec packages
2021-03-04 17:24:25 +01:00
Andrew Mason 1eea7982cd Add FindSchema RPC, run generators and set up stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-04 07:59:10 -05:00
Andrew Mason 098ac4f2b8 [workflow] Rename `(Shard)ReplicationStatus` => `(Shard)Stream`
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-02 19:01:17 -05:00
Andrew Mason d0fdccaa4b wip - add `GetWorkflows` rpc, with some TODOs for later, and generate everything
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-02 18:58:41 -05:00
Andrew Mason 59b1a2cf9b Organize vtctldata.proto and regenerate
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-02 18:53:58 -05:00
Andrew Mason 5da575eb41 Add GetSchema rpc, run generators and add stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-03-02 16:10:25 -05:00
Rohit Nayak 0170d7fb38
Add External prefix to object names to remove ambiguity
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2021-03-02 14:04:00 +01:00
Rohit Nayak 706a372178
Add ExternalSource to BinlogSource. Conditional code in MoveTables for Migrate. Migrate vtctl command.
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2021-03-02 14:02:44 +01:00
Rohit Nayak 700b378df0
Added new topo root file for external clusters. Added mount/unmount commands and tests
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2021-03-02 14:02:44 +01:00
Andrew Mason 8b1f3170b7 Add reparent RPCs, run generators, add server stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-02-24 15:47:49 -05:00
Vicent Marti 50e5f66932 Merge branch 'master' into vmg/gogoproto
Signed-off-by: Vicent Marti <vmg@strn.cat>
2021-02-24 11:54:33 +01:00
Sara Bee a2f46505ee Add /vtexplain endpoint
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-02-22 21:50:46 -05:00
Vicent Marti c6bbc94a98 proto: regenerate with gogo/protobuf
Signed-off-by: Vicent Marti <vmg@strn.cat>
2021-02-22 17:09:51 +01:00
Sara Bee 5e386a4cce [vtadmin-api] Add shards to /api/keyspaces response
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-02-19 08:31:07 -05:00
Andres Taylor 4c7f08fdf4 Stop caching after creating temp tables
Signed-off-by: Andres Taylor <andres@planetscale.com>
2021-02-09 11:46:35 +01:00
Rohit Nayak 77fd1483b7
Merge pull request #7432 from tinyspeck/sarabee-vtadmin-schemas-endpoint
Add /api/schemas endpoint to vtadmin-api
2021-02-04 23:29:54 +01:00
Rohit Nayak f03ce84308
Merge pull request #7395 from tinyspeck/am_vtctld_manage_topo
[vtctld] Migrate topo management RPCs
2021-02-04 23:28:20 +01:00
Sara Bee 8bf862243b Add /api/schemas endpoint to vtadmin-api
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-02-02 17:19:09 -05:00
Sara Bee e3088b4315 Add /api/clusters endpoint to vtadmin-api
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2021-02-01 14:51:38 -05:00
Andres Taylor 0bd2ae04da rename the new planner to gen4
Signed-off-by: Andres Taylor <andres@planetscale.com>
2021-01-25 10:42:56 +01:00
Andres Taylor 365fd3cf7b add fallback planner
Signed-off-by: Andres Taylor <andres@planetscale.com>
2021-01-25 10:16:08 +01:00
Andrew Mason c26306cc24 Add a bunch of topo management rpcs, run the generators, add test stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-24 11:22:32 -05:00
Andrew Mason d94dcaef4f Add `GetVSchema` rpc and run generators
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-23 18:30:14 -05:00
Andrew Mason 1ec725ea7f Add GetBackups (formerly `ListBackups`) rpc, generate codegen and stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-22 17:04:49 -05:00
Andrew Mason e24c3aed4a Define GetSchema RPC, run generators, add server impl stub
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-21 20:06:04 -05:00
Rohit Nayak 4264302cf6
Merge pull request #7334 from tinyspeck/am_vtctld_getsrvvschema
[vtctld] Add GetSrvVSchema command
2021-01-21 18:03:26 +01:00
Andres Taylor d54b87c83f
Merge pull request #7300 from frouioui/master
Addition of @@enable_system_settings to vtgate
2021-01-20 14:50:28 +01:00
Andrew Mason 97e552b0fc Add RPC definition for GetSrvVSchema, do all the autogenerated stuff
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-19 22:08:28 -05:00
Florent Poinsard 6723743766 modified variable name to @@enable_system_settings
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2021-01-18 18:13:03 +01:00
Andrew Mason df991aa1ea Add tablet getter RPCs, generate protos and client, and server stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-15 19:43:12 -05:00
Andrew Mason 0dfbf8f98f Add cell-related getters to protos, generate client impl, add server stubs
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-15 12:18:30 -05:00
Florent Poinsard 2ab4a76d58 Addition of @@use_reserved_connection to vtgate
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
2021-01-15 15:50:17 +01:00
Rohit Nayak 36110d81be
Merge pull request #7266 from tinyspeck/am_vtadmin_vtctld
[vtadmin] Add vtctld proxy to vtadmin API, add GetKeyspaces endpoint
2021-01-15 13:41:53 +01:00
Andrew Mason 05b68637a8 Migrate InitShardMaster=>InitShardPrimary to VtctldServer, update examples
There are no functional changes in this commit, just a pure port with
the most minor changes to ensure identical behavior (like the callback
logger).

I also updated our `proto` target to assume a standard protoc
installation (which installs a stdlib of well-known types into
/usr/local/include). We can decide if this is okay to make a
requirement, or if we should try to make this more portable in PR
review.

I also updated the local example to use the vtctldclient port, and went
through the full example with no issues.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-13 21:10:11 -05:00
Andrew Mason be4d68a2a0 Add a proto that requires vtctld access
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2021-01-07 19:28:29 -05:00
Andres Taylor 5dc6497d87 cleaned out code
Signed-off-by: Andres Taylor <andres@planetscale.com>
2021-01-07 16:00:52 +01:00
Andres Taylor 7f3c956800 Merge remote-tracking branch 'upstream/master' into horizon-planning
Signed-off-by: Andres Taylor <andres@planetscale.com>
2021-01-07 15:02:11 +01:00
Shlomi Noach b36cb240ea Adding @@session_uuid to vtgate; used as 'context' by Online DDL
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2021-01-07 10:18:46 +02:00
GuptaManan100 1c9c5ebc9b added a new version of greedy optimizer using priority queue
Signed-off-by: GuptaManan100 <manan@planetscale.com>
2020-12-30 13:51:16 +05:30
Andres Taylor c7aecd39b2 added vtgate flag and system variable to control the planner used
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-12-29 14:56:38 +01:00
Andrew Mason 1e38cde199 Embed cluster message, rather than just the name, in VTGates
There are cases where we need more than just the name, so let's make
sure we have it.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-23 19:04:35 -05:00
Rohit Nayak ceeed3ecc4
Merge pull request #7201 from tinyspeck/am_find_all_shards_in_keyspace
Add FindAllShardsInKeyspace to vtctldserver
2020-12-23 21:41:52 +01:00
Andrew Mason eae87a73e0 Merge branch 'vitessio:master' into am_find_all_shards_in_keyspace
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-17 16:15:32 -05:00
Andrew Mason 1e8a7610ac Apply copyright notices everywhere
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-16 23:07:12 -05:00
Andrew Mason 7a8386c346 Merge branch 'vitessio:master' into am_vtadmin_cluster
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-12 22:26:51 -05:00
Andrew Mason 1d6b5a527d Add ServingState to tablets, add helper function
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-12 14:05:59 -05:00
Andrew Mason 86866be420 Add simple RPCs, we have everything we need to implement them now
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-11 23:07:04 -05:00
Sara Bee b5e36a053d Move allow_alias option in MySqlFlag enum to the top
Signed-off-by: Sara Bee <855595+doeg@users.noreply.github.com>
2020-12-11 14:53:04 -05:00
Andrew Mason 025823a78b Define GetKeyspaceResponse, put topodata.Keyspace inside, update callsites and tests
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-09 13:58:03 -05:00
Andrew Mason 72cae77fe3 Initial proto with just a vtgate type def
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-08 22:26:14 -05:00
Andrew Mason 196245227d Implement FindAllShardsInKeyspace
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-08 16:26:40 -05:00
Andrew Mason ad94b672ef Merge branch 'vitessio:master' into am_vtctld_proto
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-08 14:10:00 -05:00
Andrew Mason 37fd703739 Update proto/vtctldata.proto
Co-authored-by: Derek Perkins <derek@derekperkins.com>
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-08 08:06:24 -05:00
Andrew Mason 3c7fdf37c4 Add docs to the proto service and regenerate
Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-05 23:14:29 -05:00
Andrew Mason d0547a00b0 First stab at a typed vtctld interface
I've only added some simple keyspace-related getters for now.
No documentation or tests or anything yet, this is just a
proof-of-concept / example implementation.

Signed-off-by: Andrew Mason <amason@slack-corp.com>
2020-12-05 14:10:00 -05:00
David Morhovich 4f2b4a0e4a Fixes comment to mention the existence of reference tables.
Signed-off-by: David Morhovich <david@planetscale.com>
2020-12-04 17:41:23 -05:00
deepthi 400acf3f6f remove deprecated vtctl commands, flags and vttablet rpcs
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-12-03 20:29:23 -08:00
Shlomi Noach 0fbce9c019 Adding ddl_strategy session variable
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2020-11-15 13:59:25 +02:00
Rohit Nayak 9d9aaffca8
VStream Enum/Set: add column_type with set/enum values to FIELD event
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-11-01 11:26:26 +01:00
Harshit Gangal 4f4ff33cbd added readafterwrite in session
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-10-15 18:41:04 +05:30
Shlomi Noach f31545dfc5 merge conflicts
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2020-09-23 12:16:32 +03:00
Harshit Gangal 375df58606 added last lock heartbeat sent time
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-09-14 22:57:51 +05:30
Shlomi Noach 31ae7cd17a VExecRequest to include workflow, keyspace
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2020-09-09 08:48:52 +03:00
Shlomi Noach c22146e691 vexec for schema-migrations, major refactor
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2020-09-09 08:48:52 +03:00
Shlomi Noach 1e84a62e8f cleanup, undo adding fields to proto.SchemaChange
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2020-09-09 08:48:51 +03:00
Shlomi Noach 66974c585c setting up ghost and handler
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
2020-09-08 08:18:27 +03:00
Harshit Gangal d21851e2ef added lock_session to vtgate proto
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-07-31 13:53:16 +05:30
Sugu Sougoumarane 0084e108e1
Merge pull request #6438 from planetscale/rn-vrepl-savepoint
Vrepl Savepoint: handle savepoint during vreplication and in vstream api
2020-07-22 19:31:02 -07:00
Harshit Gangal 9ef859b437
Merge pull request #6441 from planetscale/reserved-scatterconn
VTGate side of reserved connections
2020-07-17 13:02:40 +05:30
Rohit Nayak 250caba0fa
Vrepl Savepoint: change vevent proto: ddl field name to statement, use statement for dml if present, dml field is deprecated, will be removed in 8.0. set statement for savepoint and apply in vrepl/send in vstream client
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-07-16 12:12:34 +02:00
Rohit Nayak 50a50099a8
Vrepl Savepoint: handle savepoint in binlog, treated as no-ops
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-07-16 12:11:10 +02:00
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
Harshit Gangal 1f2725feee added reserved connection to vtgate session proto
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-07-14 09:12:08 +02:00
Harshit Gangal cbea46cd61 added savepoint in session
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-07-09 11:48:44 +05:30
Harshit Gangal 426781a1a5
Merge pull request #6412 from planetscale/beginexecute-prequeries
Beginexecute prequeries
2020-07-09 11:47:27 +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
Harshit Gangal 1a878c73d9 preQuery to be exec before the actual query exec
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-07-07 15:52:10 +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
deepthi ca872147e3 delete RPCs that were deprecated in 6.0
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-06-25 08:59:34 -07:00
Deepthi Sigireddi aa909c5128
Merge pull request #6296 from vitessio/find-errant-gtids
Find Errant GTIDs
2020-06-17 11:56:30 -07:00
Sugu Sougoumarane 3af27f3325
Merge pull request #6303 from planetscale/new-reserved-connections
Reserve connection protobuf changes
2020-06-15 22:07:07 -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
Sugu Sougoumarane 0b3a934c3e
Merge pull request #6232 from planetscale/rn-vscopy
VStream Copy: streaming vevents from the beginning
2020-06-14 19:17:24 -07:00
Andres Taylor 558625e4c4 reserve connection protobuf changes
Signed-off-by: Harshit Gangal <harshit@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-06-11 14:03:55 +02: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
Rohit Nayak a24770f208
VSCopy: vtgate-related changes
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-06-06 16:37:27 +02:00
Rohit Nayak ca1bcc0dd7
VSCopy: improve unified abstraction, implement catchup/ff, added LastPK Event, LastPK to VGTID, test framework for detailed testing
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-06-06 16:35:05 +02:00
deepthi 96d0d0f03a replica transactions: add TabletAlias to the grpc Request/Response. grpc client ignores the value of the alias in the response for backwards compatibility
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-06-03 11:15:09 -07:00
Andres Taylor 3f8594248e Merge remote-tracking branch 'upstream/master' into ds-replica-transaction
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-06-03 07:08:24 +02:00
Sugu Sougoumarane 5407fe75bc tm revamp: remove deprecated taabletmanager TER
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-06-02 17:15:12 -07:00
Andres Taylor 8acefe546a Cleaned up simple stuff around scatter con
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-06-02 12:06:51 +02: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
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
Rohit Nayak 8104d77230
Rename protos
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-05-31 00:16:27 +02:00
Rohit Nayak 7b54e2ad92
Basic functionality implemented. More tests needed
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-05-31 00:16:27 +02:00
Rohit Nayak 7e1706d8a4
WIP
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-05-31 00:16:27 +02:00
Andres Taylor 12c3da6f51
wip
Signed-off-by: Rohit Nayak<rohit@planetscale.com>

Signed-off-by: Rohit Nayak <rohit@planetscale.com>
2020-05-31 00:16:27 +02: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
deepthi 99faad4a5d replica transactions: initial implementation
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-05-25 15:18:31 -07:00
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
Harshit Gangal 481adffd7b Added row_count to vtgate session
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-05-13 20:26:14 +05:30
Harshit Gangal 13c9a3924e Planning passthrough set system variables
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
2020-05-04 18:20:32 +05:30
Andres Taylor 78854f31c9 Added session system variable map
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-05-04 17:13:06 +05:30
deepthi 0fa8c20296 PlannedReparent: Rename PromoteSlave -> PromoteReplica. Deprecate
PromoteSlaveWhenCaughtUp RPC

Signed-off-by: deepthi <deepthi@planetscale.com>
2020-04-14 13:50:55 -07:00
Sugu Sougoumarane 050b037aff deprecation: delete v2 protos
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-24 21:52:55 -07:00
Sugu Sougoumarane 186247f9a2 deprecation: delete v2 api code and tests
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-23 16:38:37 -07:00
Harshit Gangal 7a5af871a2
Merge pull request #5940 from planetscale/ss-deprecation
tabletserver: SBR deprecation
2020-03-20 23:14:58 +05:30
Andres Taylor f8ef3e64e8
Support for user defined variables (#5921)
* Support set statement with user defined variables

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

* Add needed bind variables

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

* Changes the session UDV holder to use BindVariable instead of query.Value

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

* Make sure to allow float values for UDVs

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

* added udv set end2end

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

* Allow @ in sql identifiers

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

* Make sure to allow variable names that contain characters that are not letters or digits

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

* Improved user defined variable testing

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

* Minor clean ups

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

* Make sure to go over all variables in the SET statement

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

Co-authored-by: Harshit Gangal <harshit@planetscale.com>
2020-03-19 12:38:10 +05:30
Sugu Sougoumarane 1d66aa041c deprecation: delete unused event token code
There was an aspiration that applications will use an event token
to validate how fresh a replica read was. The feature was neither
very usable nor used by anyone.

This has now been deleted.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-16 20:49:52 -07:00
Sugu Sougoumarane c73d6dd336 deprecation: delete UpdateStream code
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-16 20:49:51 -07:00
Sugu Sougoumarane 3f7839ecac deprecation: delete SplitQuery code
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-16 20:49:14 -07:00
Andres Taylor da21fe824c Really fix proto
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-03-16 09:54:26 +01:00
Andres Taylor 6ed2db45e7 Fixed proto defition
It somehow got mangled when merging, and one line was lost.

Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-03-16 06:52:28 +01:00
Sugu Sougoumarane 840258a2ea vstream: address review comments
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-10 13:18:06 -07:00
Sugu Sougoumarane e2761175b9 vrepl: more comments for vstreamer & binlogdata
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-02-07 08:59:56 -08:00
Sugu Sougoumarane 997835076a vrepl: document vstreamer.go, binlogdata.proto
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-02-07 08:59:53 -08:00
Deepthi Sigireddi 3670303cca
Merge pull request #5669 from planetscale/ss-vrepl-prep-lookup
vrepl: Prep for lookup vindex backfill
2020-01-12 16:23:50 -08:00
deepthi b290a373e8 delete AggregateStats, replace Resolver.stats with Resolver.queryService
Signed-off-by: deepthi <deepthi@planetscale.com>
2020-01-09 16:57:32 -08:00
Sugu Sougoumarane dfeeab56ac vreplication: stop_after_copy option
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-01-07 17:11:39 -08:00
Andres Taylor ad9c3537c1 Added LastInsertId to the grpc Session object
Signed-off-by: Andres Taylor <andres@planetscale.com>
2020-01-06 11:27:26 -08:00
Sugu Sougoumarane 434a684ee5
Merge pull request #5628 from planetscale/ss-vrepl-materialize
vrepl: Materialize command
2020-01-03 12:40:56 -08:00
Sugu Sougoumarane 9219450eac builds: fix protoc goimports issue
The protoc generated code was not matching the goimports standard.
I've added a goimports step after the build.
This caused another breakage because time.proto did not match its
package name of vttime. I've fixed that also.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-12-31 14:53:04 -08:00
Sugu Sougoumarane 4951134156 vrepl: Materialize WIP 3
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-12-30 21:22:49 -08:00
Sugu Sougoumarane 565937e267 vrepl: Materialize WIP 1
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-12-30 21:22:49 -08:00
Rafael Chacon 6593e5df30 Merge branch 'upstream-master' into vtshovel-poc 2019-11-22 17:09:45 -08:00
Sugu Sougoumarane 2ef29629d7 tabletmanager: WaitForPosition
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-02 17:35:51 -07:00
Sugu Sougoumarane cd858ac621 vdiff: resultStreamer
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-02 17:34:13 -07:00
Sugu Sougoumarane 2083acea37 mysqlctl: GetSchema also returns field info
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-11-02 17:34:11 -07:00
Anthony Yeh 9a09f820bc
PlannedReparentShard: Fix more known-recoverable problems. (#5376)
* PlannedReparentShard: Fix more known-recoverable problems.

PlannedReparentShard should be able to fix replication as long as all
tablets are reachable and all replication positions are in a
mutually-consistent state.

PRS also no longer trusts that the shard record contains up-to-date
information on the master, because we update that record asynchronously
now. Instead, it looks at MasterTermStartTime values stored in each
master tablet's record, so it makes the same choice of master as
vtgates.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>

* PlannedReparentShard: Add -lag_threshold flag.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>

* Fix expected error in reparent test.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>

* PRS: Add test case for graceful recovery.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>

* PRS: Measure replication progress instead of lag.

Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2019-10-31 12:39:03 -07:00
Anthony Yeh e8dd5a4f08 Merge branch 'master' into reparent-refactor
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2019-10-30 12:44:51 -07:00
Deepthi Sigireddi d9fa8cd683
Merge pull request #5316 from planetscale/ds-init-tablet-master-ts
InitTablet should not update master alias on shard record
2019-10-25 16:11:26 -07:00
deepthi 8b6cca05de set masterTermStartTime on tablet correctly whenever tablet type changes
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-23 18:46:58 -07:00
deepthi 57a6f4878a store master_term_start_time in tablet record. InitTablet should not update shard master
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-22 12:27:45 -07:00
yuxiaobo f886cc2681 add license in helm/misc/proto
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-10-21 17:35:53 +08:00
Rafael Chacon b56bf67d7a Update approach to not require another binary to run vtshovel
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-10-17 16:27:56 -07:00
Anthony Yeh 191d5e5be6 Merge branch 'master' into reparent-refactor
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2019-10-16 16:18:42 -07:00
Anthony Yeh 75f547126e Merge branch 'master' into reparent-refactor
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2019-10-14 11:32:50 -07:00
Sugu Sougoumarane 01b6c7a067 stream_migrater: integrate with migrater
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-10-11 19:34:14 -07:00
Rafael Chacon f903605880 Merge branch 'upstream-master' into vtshovel-poc 2019-10-10 13:38:48 -07:00
Anthony Yeh 4b12b1cf37 Merge branch 'master' into reparent-refactor
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2019-10-07 15:33:39 -07:00
deepthi ac3efb4072 Replace keyspace_type in vschema with a boolean require_explicit_routing
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-06 12:23:42 -07:00
deepthi 060f148188 save restore time and position in local_metadata instead of tablet record, more params cleanup and refactoring from reviews
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-03 15:38:12 -07:00
deepthi d689461f97 add fields to Tablet record to store which backup we restored from, and which gtid we restored to
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-03 15:33:59 -07:00
deepthi 1732232e6f add base_keyspace param to CreateKeyspace
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-03 15:33:59 -07:00
deepthi 2e77b986af CreateKeyspace for snapshot keyspaces
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-10-03 15:33:56 -07:00
Rafael Chacon 489eb3c4ac Adds proto definition to store dml extracted from Query
Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-10-03 15:21:50 -07:00
Nitin Shatma d93239c76e proto-changes
Signed-off-by: Nitin Shatma <nitin.sharma@airbnb.com>
2019-10-02 18:51:16 -07:00
Nitin Shatma b912811977 vstream optional field event
Signed-off-by: Nitin Shatma <nitin.sharma@airbnb.com>
2019-10-02 12:23:16 -07:00
Anthony Yeh 2f5a57eb21 topodata.proto: Add master_term_start_time field to Shard record.
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
2019-10-01 15:11:19 -07:00
hwdef 28abeb0985 fix some spelling mistakes
Signed-off-by: hwdef <hwdef97@gmail.com>
2019-09-27 11:15:31 +08:00
chentanjun 1a43e41322 fix-up typo
Signed-off-by: chentanjun <2799194073@qq.com>
2019-08-26 11:28:06 +08:00
Sugu Sougoumarane 19f23cc041 migrater: add more fields to Journal
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-08-03 19:52:41 -07:00
Sugu Sougoumarane 3fb294471c migrater: initial cut
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-08-03 19:52:41 -07:00
zwcn 440aa522bc use english quotes instead
Signed-off-by: zwcn <zilongwang61@gmail.com>
2019-06-26 19:13:16 -04:00
Sugu Sougoumarane 4e80ef467b vstream: address review comments
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-06-06 15:40:29 -07:00
Sugu Sougoumarane 0b59741632 vstream: RPC scaffolding
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-05-13 20:30:35 -07:00
Sugu Sougoumarane b4379fa078 consistent lookup: address review comments
The VCursor API is impressively simpler no.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-05-09 20:59:29 -07:00
Sugu Sougoumarane 91ea12e8e5 consistent lookup: commit order in Session
Added two new shard sessions for commit ordering:
pre and post.

Added API to set the commit order and changed
tx conn to honor it.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-05-05 19:36:42 -07:00
Sugu Sougoumarane 08791180dc vschema: routing rules proto changes
This is the first part of the changes to implement #4790.
This part implements all the management functionality for
routing rules.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-04-22 20:00:00 -07:00
Sugu Sougoumarane 856a196bc6 vstreamer: rowstreamer locks the table
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-04-17 11:09:54 -07:00
Sugu Sougoumarane c096533521 vplayer: copyTables initial cut
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-04-17 11:04:32 -07:00
Sugu Sougoumarane 1d2d111be9 vstreamer: VStreamRows rpc method
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-04-17 11:04:32 -07:00
SataQiu 139b49e351 fix spelling mistake: conjonction -> conjunction
Signed-off-by: SataQiu <qiushida@beyondcent.com>
2019-04-17 11:59:27 +08:00
Rafael Chacon 2c63167f11 Refactor region to aliases
* Deprecate the concept of regions.
* Favor aliases instead

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-03-29 19:28:16 -07:00
Michael Demmer 56c2a938d0
Merge pull request #4739 from tinyspeck/autocommit-batch-execute
Single round trip commit on BatchExecute
2019-03-22 08:47:38 -07:00
Rafael Chacon 20b59bb3ca Single round trip commit on BatchExecute
* When auto-commit is on, passDML is on and ExecuteBatch is in a transaction,
there is no need to explicitly create a transaction. We can forward the DML
directly to the database.
* This optimization yielded significant more throughput in vttablets. We got
around 25-30% improvement. Most of our queries are single point
inserts/updates that already use auto commit  when coming from vtgates, so this
improvement is something that we've been wanting to do for a long time.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-03-21 15:35:46 -07:00
Rafael Chacon 13aa747940 Merge branch 'upstream-master' into 4496-topo-serving-shards-refactor 2019-03-07 13:16:12 -08:00
Sugu Sougoumarane 8913fcf081
Merge pull request #4699 from planetscale/ds-allow-master-backup
allow backup on master
2019-03-06 16:20:40 -08:00
Sugu Sougoumarane 31178f975a
Merge pull request #4637 from planetscale/ss-vheart
vreplication: improved lag tracking
2019-03-03 13:28:01 -08:00
deepthi 72689e8872 allow backups on master tablet
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-03-02 16:21:08 -08:00
Kim Bao Long d0063cb907 Trivial fix: Remove the redundant words
Although it is spelling mistakes, it might make an affects while reading.

Co-Authored-By: Nguyen Phuong An <AnNP@vn.fujitsu.com>
Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
2019-02-25 14:39:32 +07:00
Sugu Sougoumarane a6f5da6c6c
Merge pull request #4550 from planetscale/ds-reparent-undo
rollback changes made during PlannedReparent if we encounter errors
2019-02-22 15:14:36 -08:00
Rafael Chacon 9272b1cd73 Add ServedType for backwards compatiblilty
* Also adds more validations and tests when rebuilding serving keyspace

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-02-18 18:26:00 -08:00
Sugu Sougoumarane 41767d84fb vreplication: improved lag tracking
The new lag tracking introduces the following changes:
* VStreamer sends its current time along with every event. This
  allows for VPlayer to correct for any clock skew that may
  exist between the two machines. This results in a more accurate
  calculation of lag.
* If there are no events to send for a period of time, VStreamer
  sends a heartbeat event. This allows us VPlayer to essentially
  know for sure that it's still caught up.
* If VPlayer receives no event for its wait period, then it updates
  the SecondsBehindMaster stat to indicate that it's actually falling
  behind.

The VStreamer timeout for heartbeat is set slightly lower than the
VPlayer idle timeout. This ensures that Vplayer won't timeout
exactly when it's about to receive the heartbeat event.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-02-17 19:35:30 -08:00
Nguyen Hai Truong 4966399ee3 Fix small errors
There are many wrong typos that need to be fixed.

Signed-off-by: Nguyen Hai Truong <nguyenhaitruonghp@gmail.com>
2019-02-13 20:03:55 -08:00
Rafael Chacon 196cf77dd0 Move serving state from global topo to srv keyspace
Initial stab at: https://github.com/vitessio/vitess/issues/4496

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2019-02-05 14:40:14 -08:00
Sugu Sougoumarane d09ce4a6d8
Merge pull request #4578 from xichengliudui/update-md-txt-proto
update .md and .txt and .proto
2019-02-04 15:30:55 -08:00
Sugu Sougoumarane 207b084ca8
Merge pull request #4555 from planetscale/ss-vrepl
vreplication: vplayer
2019-01-30 19:21:24 -08:00
xichengliudui 2efaecfa67 update .md and .txt and .proto
Signed-off-by: xichengliudui <liuduidui@beyondcent.com>
2019-01-30 10:49:12 -05:00
deepthi 16ca2c34d3 #4481 rollback changes made during reparent if we encounter errors
Signed-off-by: deepthi <deepthi@planetscale.com>
2019-01-24 17:08:13 -08: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
Sugu Sougoumarane 39e974899d vreplication: vplayer basic functionality done
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-15 22:39:54 -08:00
Sugu Sougoumarane 1f0f55e783 vreplication: vplayer WIP
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-15 22:39:54 -08:00
Sugu Sougoumarane 6ff51d39cf vreplication: tests are done
Also had to added transmission of field info, which may come
in handy for encoding the values on the player end.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-02 19:50:42 -08:00
Sugu Sougoumarane a0b948974f vreplication: got some basic tests working
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-02 19:50:42 -08:00
Sugu Sougoumarane 8cd1c5b33f vreplication: tabletserver inits and other tweaks
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-02 19:50:42 -08:00
Sugu Sougoumarane ec4e808b47 vreplication: vstreamer, plan and filtering
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-02 19:50:42 -08:00
Sugu Sougoumarane f5868c6f72 vreplication: vstreamer Engine
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2019-01-02 19:50:40 -08:00
Sugu Sougoumarane 066779f520 select *: more review comments
I also had to fixup vtexplain to make it load vschemas with enums
properly.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-11-19 15:11:46 -08:00
Sugu Sougoumarane b30a5c6a1a select *: address review comments
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-11-18 08:56:56 -08:00
Sugu Sougoumarane af9817fad2 select *: is_authoritative flag
If this flag is set for a table, we'll treat the column list
as authoritative and expand select *.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-11-18 08:14:55 -08:00
Michael Demmer 61a253c33a add a new query.QueryWarning array to the vtgate.Session proto
To enable conveying out of band warnings, add a new proto definition
for a QueryWarning and add a repeated array to the vtgate session.

Signed-off-by: Michael Demmer <mdemmer@slack-corp.com>
2018-10-27 16:01:10 -07:00
Sugu Sougoumarane b9b8cf113c resharding: safer MigrateServedTypes
MigrateServedTypes has been made idempotent: if it fails in
the middle, you can safely retry the operation. If the operation
has previously succeeded, retrying it will be a no-op (except
for master migration).

For master migration. A new Frozen field has been added to the
tablet control record. This field signifies the point of no
return. If a migrate fails before reaching this state, then
we undo everything and re-enable the source shards. Once we
go past the 'frozen' state, you can only go forward. If there
are failures after the frozen state, the migrate can be safely
retried until successful. Once successful, a retry will return
an error saying that there's no resharding in progress.

The resharding end to end test has been updated to demonstrate
these behaviors.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-10-06 18:41:19 -07:00
Rafael Chacon 8b99e7a89a Update workflow to include CreateTime
* This change allows us to sort workflows in a deterministic way.

Signed-off-by: Rafael Chacon <rafael@slack-corp.com>
2018-08-24 17:32:25 -07:00
Sugu Sougoumarane c3159d9e87
Merge pull request #4134 from sougou/pin
vschema: allow pins in vschema
2018-08-15 18:31:17 -07:00
Sugu Sougoumarane 9ab49cec53 vschema: allow pins in vschema
Pinning was an internal feature used for pinning the
dual table to shard 0. Exposing this ability in vschema
allows someone to pin an unsharded table to a specific
shard.

This is still not a full feature because we ned to
think about the various use cases like resharding etc.
But it can be used for testing purposes.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-14 15:00:30 -07:00
Sugu Sougoumarane 5a88777772 vreplication: remove deprecated Blp code
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-12 16:08:38 -07:00
Sugu Sougoumarane da48d560b4 vreplication: VReplicationWaitForPos rpc wiring
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-12 15:59:06 -07:00
Sugu Sougoumarane 90cceaf10f vreplication: try the Exec approach
The number of vreplication control functions is too high. I counted
seven at the minimum. So, I'm now trying this new approach: a single
VReplicationExec function that can execute queries. The goal is to
accept SQL statements that access a 'vreplication' table which will
be interpreted by the engine, which will in turn update the
_vt.vreplication table and also accordingly act upon the change,
like start, stop etc.

For now, these queries will only be understood by VReplicationExec.
In the future, we can look at allowing these as part of the
QueryService API.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-12 15:59:06 -07:00
Sugu Sougoumarane 1ba9dbf7dc vreplication: TabletManager.VReplicationCreate
Add VReplicationCreate method to TabletManager API.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-12 15:59:06 -07:00
Sugu Sougoumarane 7735ff1bf3 vreplication: additional fields in vreplication
Added the following fields to vreplication:
workflow: who created and manages the replication
source: source info for the replication (proto)
state: Running, Stopped, etc
message: any message relevant to current state

BinlogSource contains the source info. It currently supports only
keyrange or table list for now, but can be extended to support
other rules. The information is stored in proto 'String' format
because its keyrange rendering is more readable than JSON.

The current change only populates the fields. Next change will
use the values.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-12 15:59:06 -07:00
Sugu Sougoumarane 0a2cf17229 vreplication: change to use new _vt.vreplication
This change deprecates _vt.blp_checkpoint in favor
of vreplication, which stands for Vitess Replication.
The goal is to make vreplication a standalone sub-module
of vitess that other services can use, including the
resharding worflow.

This first step just changes to using vreplication instead of
blp_checkpoint. The table and APIs to perform more autonomous
functions.

Also, split strategy flags were unsafe and untested. So, they
have been deleted. More wholistic operations will be added
to better manage resharding and vreplication.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2018-08-12 15:59:06 -07:00
David Weitzman 3c64a22828 Upgrade golang protobuf to v1.1.0
Also, simplify the protoc call by removing some intermediate tools and steps involving the python grpcio-tools wrapper.
The motivation for changing the build was that I had trouble getting the old build to work. It might just have been me.
This approach is arguably simpler because it involves fewer tools, no temp files, and no calling "sed" on the output.

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2018-06-13 20:13:05 -07:00
Anthony Yeh 8be2b63468 mysqlctl: Execute RefreshConfig remotely if requested.
This makes RefreshConfig match the behavior of ReinitConfig.
Since the initial InitConfig happens in mysqlctld, it's important that
vttablet requests mysqlctld to regenerate config remotely, or else it
may not use the same settings.
2018-02-02 21:10:24 -08:00
Alain Jobart ce325897ca Proto changes for aggregate stats.
This would allow re-using the current StreamHealthCheck to convey the
status of a group of tablets, between vtgate and l2vtgate (which will
be merged into vtgate).
2018-01-12 10:33:09 -08:00
Rafael Chacon 4911fe358f Initial commit for multi column index 2017-12-27 22:09:57 -08:00
Sugu Sougoumarane 2ad2b053f0 vschema: add support for column info
This is the first step towards making VTGate more schema aware.
The VSchema has been extended to include a list of columns and
their types.

For now, this info has to be supplied as part of the VSchema.
In the future, this can be dynamically updated by vtgates
through a new protocol that will allow the vtgates to
subscribe to schema changes from the vttablets.

It's still useful to manually provide this information because
it can be used as fallback in case the auto-update mechanism
fails.

With this added awareness, two new features can be built:
1. If a column contains text, VTGate can use this information
   for collating values correctly.
2. Add a strict mode where VTGate will reject a query if
   unrecognized column names are used. Also, we can auto-resolve
   column names to the correct table if they are unique in a query.

As part of this change, I added some additional wrappers in json2
for protos. This is because the default behavior does not encode
or decode enums in a user-friendly manner.
2017-12-26 15:11:27 -08:00
huiqing zhou e0ae56b46d doc updates 2017-12-13 17:04:15 -08:00
huiqing zhou 482cf3e2a8 region/cell feature 2017-12-08 10:53:28 -08:00
Rafael Chacon d37ad9b428 Adds session option to cache query plans 2017-09-30 16:46:40 -07:00
Bryan Beaudreault d59de09111 allow setting transaction isolation on vtgate session/executeoptions. enforce per-transaction before calling begin 2017-08-23 16:20:00 -04:00
Bryan Beaudreault a270edb4c6 add migration workload 2017-08-22 15:39:34 -04:00
Bryan Beaudreault 5faaac2315 Adds support for SET NAMES and SET CHARSET as a no-op to support mysql-connector-j
support for sql_select_limit, more values of character_set_results, and ignoring net_write_timeout

handle default case, and fix npe

validate charsets
2017-08-18 07:32:09 -04:00