-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Point in time recovery (PITR) #4886
Comments
@deepthi since #5160 is merged, does that mean that Vitess 4.0 (checking release notes) has the ability to do these keyspace snapshots? Is there any documentation on how to do that? |
Yes, this is available in Vitess 4.0. To use this feature, you first create a SNAPSHOT keyspace.
Then you bring up a vttablet with the following flags
The That's it! I also have some scripts that I used for local testing that I can share. |
Fixed. |
Feature Description
The ability to recover data in vitess to a (past) point in time.
It should be possible to have multiple recovery requests active at the same time.
It should also be possible to recover across sharding actions, i.e., you should be able to recover to a time when there were two shards even though at present there are four.
Use Case(s)
Preconditions
Proposed design
Create a new keyspace
We will add the ability to create a new type of keyspace called a
Snapshot
keyspace. The normal keyspaces will have the (unimaginative) type ofNormal
. When a snapshot keyspace is created, a time is assigned to it, which is the time you want to recover to. The time will be in UTC. Snapshot keyspaces are always created off abase
keyspace.Start VTTablets
VTTablets will be started with their init_keyspace command-line-param set to the newly created snapshot keyspace. They will look for the most recent usable backup of the base keyspace (and specified -init_shard) that is earlier than the snapshot time and restore from that.
It is the responsibility of the operator to provide the correct -init_shard value while starting up vttablets.
The timestamp of the backup that was used for restoring will be saved in the local_metadata table along with the position (GTID) that was restored.
VTGate routing
VTGate will automatically exclude tablets belonging to snapshot keyspaces from query routing unless they are specifically addressed using
use ks
or by using queries of the formselect ... from ks.table
VSchema
The base keyspace's vschema will be copied over to the new snapshot keyspace as a default. If desired this can be overwritten by the operator. Care needs to be taken to set
require_explicit_routing
to true when modifying a snapshot keyspace's vschema.Applying Binlogs
#6267
The text was updated successfully, but these errors were encountered: