Open bmatican opened 3 years ago
One other note, I was discussing with @spolitov , we currently do not keep any history retention information with the snapshot. If we did, we could potentially reject a restore to a time in the past, before the history retention.
Example: say, you had only 1h of history retention, but on restore, you provide a time that is 2h in the past, from the snapshot time. We might not have the right information for certain keys, if you were getting updates for the whole 2h, but we only kept the last 1h.
This should be easy enough to add with the snapshot information. Then when we could have access to this in the snapshot meta, that we export via yb_backup. This would allow us to then compute the max hybrid time, that is guaranteed to have data within the history retention of all snapshots and use that as a cutoff on restore.
Jira Link: DB-1584 Currently, we support PITR only in cluster, on snapshot schedules. This allows us to rollback both data (DML) and metadata (DDL) operations. However, the primitives are still based on snapshots, so there's nothing fundamental that would prevent us from allowing PITR on data in external backups.
To begin with, we could extend our existing
yb_backup
tool, to also take in a user timestamp and apply it when calling down toyb-admin restore_snapshot
. A couple of limitations from thisyb_backup
yb_backup
and the only user of that right now is the platform product