Repository navigation
Backport #107357 to 25.8: Avoid storing S3 credentials in backup metadata - #108847
Merged
Merged
Conversation
Contributor
|
Workflow [BackportPR], commit [bc0ec9f] |
Use `std::make_shared` instead of unavailable `make_intrusive` on 25.8. CI: #108847
Contributor
There was a problem hiding this comment.
Pull request overview
Backport of the upstream fix to prevent incremental backup metadata (.backup) from persisting S3 credentials in the serialized <base_backup> locator, while preserving backward compatibility for older metadata that did embed credentials.
Changes:
- Add
BackupInfo::withoutS3Credentials()(with optionalContext) andcanCopyS3CredentialsTo()to support credential stripping and safe “copy credentials” checks. - Update
BackupImplto (a) avoid mutating/storing credential-copiedbase_backup_info, (b) serialize base-backup locators with credentials removed, and (c) emit/consume a non-secret metadata marker to copy inline credentials at restore time when safe. - Add unit and query tests covering URL redaction, expression evaluation, marker behavior, and backward compatibility.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/queries/0_stateless/04327_backup_s3_base_credentials_metadata.sh | New stateless test validating that <base_backup> metadata doesn’t contain S3 credentials and that restores behave correctly (including backward-compat). |
| tests/queries/0_stateless/04327_backup_s3_base_credentials_metadata.reference | Expected output for the new stateless test. |
| tests/queries/0_stateless/02843_backup_use_same_s3_credentials_for_base_backup.sh | Removes old test logic that relied on credentials being stored in metadata. |
| src/Backups/tests/gtest_backup_info.cpp | New gtest coverage for withoutS3Credentials() redaction and expression evaluation behavior. |
| src/Backups/BackupInfo.h | Declares canCopyS3CredentialsTo() and withoutS3Credentials(). |
| src/Backups/BackupInfo.cpp | Implements S3 credential stripping (positional, key-value, extra_credentials, URL userinfo/presign params) and copy-eligibility check. |
| src/Backups/BackupImpl.h | Adds a flag to honor the new restore-time credential copy marker from metadata. |
| src/Backups/BackupImpl.cpp | Ensures .backup serialization never persists base-backup S3 credentials; adds marker write/read and restore-time copying logic without mutating stored base_backup_info. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Accept `external_id` in `S3` `extra_credentials` and pass it to STS assume-role credentials so `04327` succeeds on the `25.8` backport. Also align `02843` with current restore behavior by removing the stale restore failure expectation. PR: #108847
Pass `external_id` to the remaining `BackupReaderS3` construction in read mode after adding the constructor parameter. PR: #108847
This file contains hidden or 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
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.
Original pull-request #107357
Cherry-pick pull-request #108840
This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.
The PR source
The PR is created in the CI job
Version info
25.8.26.8