-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
release-22.1: backupccl: reduce over-splitting during RESTORE #91141
release-22.1: backupccl: reduce over-splitting during RESTORE #91141
Conversation
Thanks for opening a backport. Please check the backport criteria before merging:
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
Add a brief release justification to the body of your PR to justify this backport. Some other things to consider:
|
Letting CI shake out any issues, because this was not a clean backport. ahh also i'll need to cherry pick the commit that makes it a setting. |
62feb57
to
1bb5f10
Compare
1bb5f10
to
4727687
Compare
I'm now going to run some roachtest/restores with this diff to ensure it works as expected. |
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.
looks great!
Either in this PR or elsewhere, we should add a roachtest that restores from TPCCInc from a random incremental layer ,with target span size set to 384. This will provide extra coverage that this setting performs well on a variety of restore span configurations.
^i'm also considering adding a backportable roachtest to master that starts a workload, creates backup chain, takes a fingerprint at some random system time, and restores at the fingerprint time and verifies things look the same. |
|
Previously sstBatcher had a boolean to control whether it would split and then scatter a range it was filling when it could determine that it was about to overfill it i.e. if had previously reported its remaining capacity to be less than what the batcher was about to add. RESTORE set this boolean to disable this splitting and scattering as it pre-split and pre-scattered all of its ranges and thus did not expect the batcher to need to do any as-it-fills splitting and scattering. However blanket disabling this makes little sense: if the batcher knows that it is about to overfill a range, regardless of whether or not that range was supposed to be pre-split to avoid this, it always makes sense to split it before adding to it, rather than overfill it. Thus this change makes as-we-fill splits unconditional, and moves the boolean to be more narrowly scoped to just disabling the scatters, as RESTORE still pre-scatters its pre-chunked restore spans. This paves the way for RESTORE to make and pre-split larger chunks, without worrying if doing so will cause overfilling of ranges. Release note: none. Release justification: bug fix.
4727687
to
bc460f2
Compare
I broke something with the rebase, taking a look. |
bc460f2
to
eed0ac1
Compare
When constructing the spans to restore, we can produce fewer, wider spans that each contain more files to avoid splitting as much. Previously we split at the bounds of every file in the base backup, then added incremental layer files to any span they overlapped. This changes that slightly to keep appending files that would create a new span at the right-hand-side of the span covering to instead extend current rightmost entry in the covering if the total size of what has been added to it is still below our target size per span (384mb). Release justification: bug fix. Release note (bug fix): reduce the amount that RESTORE over-splits.
Release note: none.
eed0ac1
to
138be7b
Compare
Backport 2/2 commits from #86496.
/cc @cockroachdb/release
When constructing the spans to restore, we can produce fewer, wider spans
that each contain more files to avoid splitting as much.
Previously we split at the bounds of every file in the base backup, then
added incremental layer files to any span they overlapped. This changes
that slightly to keep appending files that would create a new span at the
right-hand-side of the span covering to instead extend current rightmost
entry in the covering if the total size of what has been added to it is
still below our target size per span (384mb).
Release justification: bug fix.
Release note (bug fix): reduce the amount that RESTORE over-splits ranges. The
behavior is enabled by default.