-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
backupccl: fix error during span-merging optimization #66840
Conversation
6b37e41
to
030c3f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @pbardea)
pkg/ccl/backupccl/backup_planning.go, line 366 at r1 (raw file):
if rawTbl != nil && rawTbl.Public() { tbl := tabledesc.NewBuilder(rawTbl).BuildImmutableTable() // endTime is safe to pass in here because if the scan at endTime is different than
i'm a little confused by this comment since we are still passing in rev.Time.
pkg/ccl/backupccl/backup_test.go, line 8424 at r1 (raw file):
// doesn't produce an error when there are span-merging opportunities on // descriptor revisions from before the GC threshold of the table. func TestSpanMergeingBeforeGCThreshold(t *testing.T) {
really nice test
pkg/ccl/backupccl/backup_test.go, line 8439 at r1 (raw file):
/* Produce a table with the following indexes over time: |
the formatting looks a little off in Reviewable.
030c3f7
to
f70cc89
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru and @pbardea)
pkg/ccl/backupccl/backup_planning.go, line 366 at r1 (raw file):
Previously, adityamaru (Aditya Maru) wrote…
i'm a little confused by this comment since we are still passing in rev.Time.
Thanks for catching... this was leftover from some prototyping.
pkg/ccl/backupccl/backup_test.go, line 8439 at r1 (raw file):
Previously, adityamaru (Aditya Maru) wrote…
the formatting looks a little off in Reviewable.
Played around with it and I think this did the trick...
This commit fixes a bug where a backup may crash if a full backup with revision history is taken on a table that has index-merging opportunities on descriptor revisions that lie before the GC TTL of the table. Since the merging of index-spans during backup planning is entirely an optimization (in an effort to reduce the number of spans we place a protectedts over), it is safe to ignore such errors and treat it as un-mergable. Release note (bug fix): Fix an error that backup would produce in some full backups with revision history. Previously some full backups would erroneously produce an error in the form of `batch timestamp <some_timestamp> must be after replica GC threshold <some_other_timestamp>`.
f70cc89
to
622722c
Compare
Played around with the formatting of the comment a bit more to make the linter happy. I think all editors/github/reviewable should all see the same thing now though. |
Build succeeded: |
This commit fixes a bug where a backup may crash if a full backup with
revision history is taken on a table that has index-merging
opportunities on descriptor revisions that lie before the GC TTL of the
table.
Since the merging of index-spans during backup planning is entirely an
optimization (in an effort to reduce the number of spans we place a
protectedts over), it is safe to ignore such errors and treat it as
un-mergable.
Fixes #66797.
Release note (bug fix): Fix an error that backup would produce in some
full backups with revision history. Previously some full backups would
erroneously produce an error in the form of
batch timestamp <some_timestamp> must be after replica GC threshold <some_other_timestamp>
.