forked from greenplum-db/gpbackup-archive
-
Notifications
You must be signed in to change notification settings - Fork 3
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
ADBDEV-4338: Fix gprestore with --resize-cluster to a smaller one #40
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When restoring a large cluster to a smaller one with the --resize-cluster option, the error "Found incorrect number of backup files" occurs. This error occurs when checking a backup, when the pgrestore expects an increased set of data in the backup directories for certain segments, but in fact this is not the case. Moreover, if you disable the checking, another error will appear indicating that not all expected data was restored. This patch fixes both of these bugs. To correct the first error, the patch collects actual data not only from the directory for one segment, but also from the remaining directories that will be restored on this segment. To correct the second error, the patch changes the path to the file being restored, replacing not only the file name, but also the directory name. This can be done because the path always contains the sequence "...SegmentNumber/backups/..." Tests for restoring with the --resize-cluster option to a smaller cluster contained the moveSegmentBackupFiles function, which moved the backup data to the required directories. Now you don't need to do this anymore.
RekGRpth
force-pushed
the
ADBDEV-4338
branch
from
September 25, 2023 09:01
129eb4e
to
79acfa9
Compare
dnskvlnk
previously approved these changes
Nov 14, 2023
InnerLife0
reviewed
Nov 27, 2023
InnerLife0
approved these changes
Nov 28, 2023
dnskvlnk
approved these changes
Dec 1, 2023
Upstream solved the problem in another way https://github.com/greenplum-db/gpbackup/pull/739 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix gprestore with --resize-cluster to a smaller one
When restoring a large cluster to a smaller one with the --resize-cluster
option, the error "Found incorrect number of backup files" occurs.
This error occurs when checking a backup, when the pgrestore expects
an increased set of data in the backup directories for certain segments,
but in fact this is not the case. Moreover, if you disable the checking,
another error will appear indicating that not all expected data was restored.
This patch fixes both of these bugs.
To correct the first error, the patch collects actual data not only from
the directory for one segment, but also from the remaining directories
that will be restored on this segment.
To correct the second error, the patch changes the path to the file
being restored, replacing not only the file name,
but also the directory name. This can be done because the path always
contains the sequence "...SegmentNumber/backups/..."
Tests for restoring with the --resize-cluster option to a smaller cluster
contained the moveSegmentBackupFiles function, which moved the backup data
to the required directories. Now you don't need to do this anymore.