Skip to content

Cherry pick #94617 to 25.3: Fix permission issues in BACKUP/RESTORE operations#94809

Merged
pamarcos merged 11 commits intobackport/25.3/94617from
cherrypick/25.3/94617
Jan 22, 2026
Merged

Cherry pick #94617 to 25.3: Fix permission issues in BACKUP/RESTORE operations#94809
pamarcos merged 11 commits intobackport/25.3/94617from
cherrypick/25.3/94617

Conversation

@robot-clickhouse
Copy link
Copy Markdown
Member

Original pull-request #94617

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.

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

pamarcos and others added 10 commits January 19, 2026 17:58
1. Forbid RESTORE in readonly mode - RESTORE modifies data, so it
   should be blocked when `readonly` setting is enabled
2. Forbid `internal` setting for initial queries - this setting is
   only meant for ON CLUSTER secondary queries, not user-specified
3. Check BACKUP permissions before opening backup destination - prevents
   establishing S3/remote connections before access is verified
The previous check `if (readonly)` blocked RESTORE for both readonly=1
and readonly=2. However, readonly=2 is automatically set by the HTTP
interface for non-POST requests to protect against accidental writes.
This was causing legitimate RESTORE operations via HTTP sessions to fail.

Now we only block readonly=1 (strict read-only mode explicitly set by
the user) while allowing readonly=2 which is used by the HTTP interface
for its automatic protection mechanism.
Fix permission issues in BACKUP/RESTORE operations
@robot-clickhouse robot-clickhouse 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-critical-bugfix labels Jan 22, 2026
@pamarcos pamarcos merged commit 5af87a2 into backport/25.3/94617 Jan 22, 2026
@pamarcos pamarcos deleted the cherrypick/25.3/94617 branch January 22, 2026 12:51
@clickhouse-gh clickhouse-gh bot added the ready-for-backport PR is eligible for backporting (merged 7+ days ago, not reverted) label Mar 27, 2026
@maxknv maxknv removed the ready-for-backport PR is eligible for backporting (merged 7+ days ago, not reverted) label Mar 27, 2026
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-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants