vitessio / vitess

Vitess is a database clustering system for horizontal scaling of MySQL.
http://vitess.io
Apache License 2.0
18.48k stars 2.09k forks source link

Question: Vitess how to find the backup which shoud be used to restore? #13328

Closed vczyh closed 1 year ago

vczyh commented 1 year ago

Question

Every backup MANIFEST have BackupTime and FinishedTime. To retore to 3:00, we should use the last backup that finished earlier than 3:00, rather than start time. So should vitess use FinishedTime?

But now useing BackupTime in vitess restore code:

https://github.com/vitessio/vitess/blob/24d24bb4199cb680b4111a044e0998dfb041b1ad/go/vt/mysqlctl/backupengine.go#L424

mattlord commented 1 year ago

No, it should be backup time. That's when the backup was taken using a snapshot of the data at that time. So what matters is the time that the snapshot is created (in whatever way varies by backup method), not how long it takes to create a backup from that snapshot.

vczyh commented 1 year ago

No, it should be backup time. That's when the backup was taken using a snapshot of the data at that time. So what matters is the time that the snapshot is created (in whatever way varies by backup method), not how long it takes to create a backup from that snapshot.

image

Between A and B, writing is allowed, because mysql is not locked. If we want to arrive F between A and B, then F may contain the data after A if using A backup.

mattlord commented 1 year ago

If you feel that there is a bug — what you’re describing would be IMO — then please open an issue with a test case demonstrating it. Thank you!