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>
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>
* 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>
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>
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>
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>
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>
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>
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>