Skip to content

Cherry pick #117429 to 26.8: Mask secrets in SHOW CREATE DATABASE of a Backup database - #121967

Merged
robot-clickhouse-ci-1 merged 3 commits into
backport/26.8/117429from
cherrypick/26.8/117429
Sep 25, 2026
Merged

robot-clickhouse-ci-1 merged 3 commits into
backport/26.8/117429from
cherrypick/26.8/117429

Conversation

@robot-ch-test-poll4

Copy link
Copy Markdown
Contributor

Original pull-request #117429

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Before you resolve anything

Conflicts are often caused by a prerequisite change that has not been backported yet, rather than by a real divergence. The bot re-tries this cherry-pick against the release branch on every run, so if that is the case here it will merge itself as soon as the prerequisite lands, and you will see a comment saying so. Manual resolution is only needed while the conflict persists.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

groeneai and others added 2 commits September 21, 2026 06:17
`SHOW CREATE DATABASE` of a `Backup` database renders the locator as the function
it is since #118674, so the pre-existing nested-`S3` rule redacts it. What is left
are the shapes that rule does not model, and the messages that reject a locator:

- A `Backup` engine with an arity other than two, or with a first argument that is
  no literal, hides every argument: a locator can be written in either position,
  and the statement is formatted for logging before validation rejects it.
- A locator whose engine is not `S3` keeps its engine name and argument count and
  hides every argument, unless the engine reads exactly the literal arguments it
  accepts, which name a destination and no credential (`File`, `Disk`, `Memory`,
  `Null`).
- An `AzureBlobStorage` backup destination reads a different signature than the
  table engine of the same name: a shared access signature beside a two-argument
  url, an `account_key` in the longer forms, named-collection overrides. It gets
  its own rule, and both rules now fail closed on an argument that neither
  `maskAzureConnectionString` nor the plain-account-url check can read, instead of
  leaving it visible.
- `BackupInfo::fromAST`, `checkAndGetLiteralArgument` for `database_name`,
  `StorageS3Configuration::collectCredentials` and the two duplicate-definition
  checks of `BackupMetadataFinder` formatted the argument they reject into their
  messages, which reach the error log and `query_log.exception`. A nested map such
  as `headers(..)` is masked only by its enclosing formatter, so one formatted on
  its own prints its values: none of these echoes the argument now.

Rebased on #118674 and reduced to the above. The definition rendering, the
acceptance of a locator held in a string literal on the metadata-replay paths and
the preflight refusal of one elsewhere are that PR's, and its own tests cover them.
…-secret

Mask secrets in SHOW CREATE DATABASE of a Backup database
@robot-ch-test-poll4 robot-ch-test-poll4 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Sep 24, 2026
@groeneai

Copy link
Copy Markdown
Collaborator

Same prerequisite as the 26.9 arm, with byte-identical conflict inputs

Full analysis on the 26.9 arm: #121968 (comment)

26.8 is the closest case to 26.9. The three conflicting files here (src/Databases/DatabaseBackup.cpp and the 04510_s3_explicit_url_named_secret_mask pair) have conflict inputs whose three index stages (base, cherry-pick side, release side) are byte-identical to 26.9's, so the two arms resolve the same way and fail the same way.

The blocker is the same: #118674 is on no release branch, and #117429's 05233_database_backup_locator_secret_mask and test_database_backup_engine_azure_display_surfaces assert a locator rendered as a nested function, which only #118674 produces. Resolving the conflict does not make either test pass.

So this arm needs the same decision, and if #118674 is backported, 26.8 needs nothing from me: _retry_cherrypick handles it.

@robot-clickhouse-ci-1

Copy link
Copy Markdown
Contributor

The 26.8 branch moved since this cherry-pick was created (now at da58eed). Re-tried the merge against it and it applies cleanly, so the bot is proceeding without manual resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants