Add a vtbackup batch command to take a backup and exit#4858
Add a vtbackup batch command to take a backup and exit#4858dkhenry merged 26 commits intovitessio:masterfrom
Conversation
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Removing whitespace and renaming flag Signed-off-by: Dan Kozlowski <koz@planetscale.com>
|
Q: what is the motivation for this feature? |
|
The motivation for this feature is to have the backup workflow of
|
This seems like a nice way to update your backups to be more current. |
|
There is. The busy loop that is there is to wait until the tablet catches up. It won't set SERVING until it is caught up, however on @enisoc 's suggestion I am swithing this to work with explicit |
… of tablet Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
sougou
left a comment
There was a problem hiding this comment.
I like how you did this. It's elegant and clean.
However, I have to agree with @enisoc. This brings in a fundamental change to what vttablet is: instead of being a server, it becomes a job. I think this will cause problems in the future.
This job has to be done from outside, ideally by an automation layer like a script or an operator.
This removes the backup_only from vttablet and creates a new binary only for backups. This binary does not register itsself with the topo server, but it does still require a valid tablet alias to facilitate replication. This can also be though of as Just Enough Vitess for Backup Signed-off-by: Dan Kozlowski <koz@planetscale.com>
|
I haven't reviewed it in detail yet, but the new approach looks awesome! This seems like it'll have all the nice properties we wanted in the long-term solution. Let me know when you've got it ready for final review. |
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
The lag value can lie. Also we're guaranteed to hit the snapshot position eventually as long as replication is making progress. If our goal is a lag value, we may never catch up if replication is slower than the rate of new transactions on the master. Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
vtbackup: Clean up and add policy enforcement
Requiring that no tablets are running at all was too strict. It prevented using the new -wait_for_backup_interval flag to start up tablets concurrently while the initial backup is going. Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
This makes it better match the state that you'd have if you used InitShardMaster instead. Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Also adding in support for non initial_backup backup being taken with vtbackup Signed-off-by: Dan Kozlowski <koz@planetscale.com>
…k-backup-only Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Teardown option is no longer used Signed-off-by: Dan Kozlowski <koz@planetscale.com>
…-only Signed-off-by: Dan Kozlowski <koz@planetscale.com>
This block of code doesn't make any sense the way its written and I feel something has been lost in translation. I have modified it so at least I can explain it. If you have no backups you will return ErrNoBackup. If you fail to reset replication you will log that message If you fail to Populate the Metadata tables we will return that error Signed-off-by: Dan Kozlowski <koz@planetscale.com>
We need to create a backup with the new timestamp so we know that our backups are fresh. Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
Signed-off-by: Anthony Yeh <enisoc@planetscale.com>
|
@enisoc yes this is ready for re-review |
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
Signed-off-by: Dan Kozlowski <koz@planetscale.com>
This adds a new
vtbackupbinary, which is a batch command that allows taking a backup without shutting down a running tablet. The vtbackup command will restore from the latest backup, silently replicate the latest changes without joining the Vitess cluster as a tablet, then take a new backup and exit.Signed-off-by: Dan Kozlowski koz@planetscale.com