You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
backup: ValidateEndTimeAndTruncate now supports compacted backups with rev history
Previously, the logic in `ValidateEndTimeAndTruncate` assumed that for a
revision history backup tree, there would be no compacted backups. This
patch teaches the function to now work with trees that contain both
revision history backups and compacted backups. The logic works as such:
1. Compacted backups that cover the requested AOST (but do not have a
matching end time) are elided.
2. Any preceding compacted backups will still be included and its
component backups elided.
This patch is part of a larger effort to fully support compactions in
revision history trees.
Informs: #158696
Release note: None
// This backup precedes the requested time, so continue.
979
996
continue
997
+
} elseifendTime.LessEq(b.Start()) {
998
+
// We've overshot the requested time, so no subsequent backups will cover
999
+
// it. This implies the user has requested an arbitrary time without a
1000
+
// covering revision history backup.
1001
+
returnnil, arbitraryTimeErr()
980
1002
}
981
1003
982
-
// Ensure that the backup actually has revision history.
1004
+
// At this point, we know that b.Start() < endTime <= b.End(). If endTime !=
1005
+
// b.End(), then this backup only covers the time if it is a revision
1006
+
// history backup.
983
1007
if!endTime.Equal(b.End()) {
984
1008
ifb.MVCC() !=backuppb.MVCCFilter_All {
985
-
consterrPrefix="invalid RESTORE timestamp: restoring to arbitrary time requires that BACKUP for requested time be created with 'revision_history' option."
986
-
ifi==0 {
987
-
returnnil, errors.Errorf(
988
-
errPrefix+" nearest backup time is %s",
989
-
timeutil.Unix(0, b.End().WallTime).UTC(),
990
-
)
1009
+
ifi<len(manifests)-1 {
1010
+
// This backup is not a revision history backup, but subsequent
1011
+
// backups might be (e.g. revision history backup chain that contains
0 commit comments