Skip to content

Keep Azure extra_credentials in persisted and rewritten engine args - #127932

Merged
dhtclk merged 1 commit into
ClickHouse:masterfrom
omar12eladawy:fix-azure-extra-credentials-engine-args
Oct 30, 2026
Merged

dhtclk merged 1 commit into
ClickHouse:masterfrom
omar12eladawy:fix-azure-extra-credentials-engine-args

Conversation

@omar12eladawy

@omar12eladawy omar12eladawy commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: #112637

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix Azure extra_credentials(client_id = ..., tenant_id = ...) being lost from the table definition after DETACH/ATTACH or a server restart, and failing when the arguments are rewritten for azureBlobStorageCluster / parallel replicas.

Details

Split out of #112637 at review request so it can be backported on its own.

  • AzureStorageParsedArguments::fromAST removed extra_credentials from the engine args and never put it back. Those args are the persisted table definition, so the explicit client_id / tenant_id were gone after a reattach or restart. They are now restored after parsing, as the S3 parser does.
  • addStructureAndFormatToArgsIfNeededAzure evaluated extra_credentials as a constant expression, which threw while preparing cluster or parallel-replica queries. It is now taken out during the rewrite and appended back.

Both cases are covered by new gtests in gtest_azure_configuration.cpp that fail on master.

cc @SmitaRKulkarni

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/127932]

Version info

  • Merged into: 26.11.1.919-master (included in 26.11 and later)

- fromAST removed extra_credentials from the engine args and never put it
  back. Those args are the stored table definition, so explicit
  client_id / tenant_id were lost on detach/attach or restart. Restore them
  after parsing, as the S3 parser does.
- addStructureAndFormatToArgsIfNeededAzure evaluated extra_credentials as a
  constant expression, which threw when preparing deltaLakeAzureCluster or
  parallel-replica queries. Take it out during the rewrite and append it back.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SmitaRKulkarni SmitaRKulkarni self-assigned this Oct 27, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-azure Azure Blob Storage integration (credentials, multipart, Azure-specific IO). label Oct 27, 2026
@SmitaRKulkarni SmitaRKulkarni added the can be tested Allows running workflows for external contributors label Oct 27, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [caed72e]

Summary: ❌

job_name test_name status info comment
Build profile diff ERROR

AI Review

Summary

The PR preserves Azure extra_credentials in persisted engine arguments and during format/structure rewriting, fixing credential loss after reattachment and exceptions during distributed query preparation. No actionable findings at commit caed72ee01c64abca58be8d88d4b5da501231d9b.

Missing context / blind spots
  • ⚠️ The unit-test jobs are still pending, so execution of the two added regression tests remains unverified. Tests were not run locally; successful unit-test results would close this gap. CI report.
Final Verdict

Status: ✅ Approve. No code changes requested; normal CI validation remains pending.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Oct 27, 2026
@clickhouse-gh clickhouse-gh Bot added the external Author is not a member of the ClickHouse organization label Oct 28, 2026
omar12eladawy added a commit to omar12eladawy/ClickHouse that referenced this pull request Oct 30, 2026
The fix that keeps extra_credentials in persisted and rewritten engine args
is a pre-existing bug on master and now lives in ClickHouse#127932. Revert it here,
together with the reattach test that depends on it.

This reverts commits d8b8aa6 and 404d491.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@SmitaRKulkarni SmitaRKulkarni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SmitaRKulkarni
SmitaRKulkarni added this pull request to the merge queue Oct 30, 2026
@dhtclk
dhtclk removed this pull request from the merge queue due to a manual request Oct 30, 2026
@dhtclk
dhtclk added this pull request to the merge queue Oct 30, 2026
Merged via the queue into ClickHouse:master with commit c759533 Oct 30, 2026
176 of 178 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 30, 2026
omar12eladawy added a commit to omar12eladawy/ClickHouse that referenced this pull request Oct 30, 2026
Restores 404d491 now that the extra_credentials engine-args fix
(ClickHouse#127932) is on master. Parse DeltaLakeAzure engine args with
extra_credentials twice, as on create and attach, with conflicting
AZURE_CLIENT_ID / AZURE_TENANT_ID in the environment, and check the
explicit IDs reach the builder options.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Oct 31, 2026
…age-partition-strategy-key-value

Resolve the conflict with ClickHouse#127932, which landed the `extra_credentials`
handling of this branch on master: `fromAST` re-appends it through a
`SCOPE_EXIT`, and the cluster rewrite sets it aside and appends it back.
Take master's version of that code and keep only the key-value
`partition_strategy` / `partition_columns_in_data_file` handling on top:

- `fromAST`: drop this branch's own re-append of `extra_credentials`,
  master's `SCOPE_EXIT` already does it (keeping both would append it
  twice).
- cluster rewrite: split the trailing key-value arguments off after
  master's `extractExtraCredentials`, and insert them back before
  `extra_credentials`, so the rewritten arguments keep the order
  positional, key-value, `extra_credentials`.
- `gtest_azure_configuration.cpp`: take master's file; its
  `FromASTKeepsExtraCredentialsInEngineArgs` and
  `AddStructureAndFormatKeepsExtraCredentials` cover what this branch's
  `FromASTKeepsExtraCredentialsInTableDefinition` covered.
- `TableFunctionObjectStorageCluster.cpp`: take master's file; the
  `extra_credentials` documentation row is not part of the
  `partition_strategy` fix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-azure Azure Blob Storage integration (credentials, multipart, Azure-specific IO). external Author is not a member of the ClickHouse organization pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants