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

278 Коммитов

Автор SHA1 Сообщение Дата
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