Skip to content

Revert onelake_bearer_token PR - #109597

Merged
SmitaRKulkarni merged 1 commit into
masterfrom
asya/remove_token
Jul 7, 2026
Merged

SmitaRKulkarni merged 1 commit into
masterfrom
asya/remove_token

Conversation

@asya-ch

@asya-ch asya-ch commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator

Remove onelake_bearer_token option for OneLake catalogs. Currently, if the token is expired, the database fails to attach, and the node cannot come up.

Will investigate and remerge with a fix.

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.7.1.575 (included in 26.7 and later)

This reverts commit 6635025, reversing
changes made to 76cfd3a.
@mintlify

mintlify Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
ClickHouse-docs 🔴 Failed – Jul 7, 2026, 3:34 AM

@asya-ch asya-ch changed the title Revert "Merge pull request #109104 from ClickHouse/asya/onelake" Revert onelake_bearer_token PR Jul 7, 2026
@clickhouse-gh

clickhouse-gh Bot commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [5ce9faa]

Summary: ❌

job_name test_name status info comment
Stress test (amd_tsan) ERROR IGNORED

AI Review

Summary

This PR reverts onelake_bearer_token support in DataLakeCatalog so expired static OneLake tokens no longer block fresh uses of the feature. The revert is not safe to merge as written: it removes the setting from the parser, so any existing database metadata that already persisted onelake_bearer_token now fails during ATTACH with UNKNOWN_SETTING, which preserves the same startup failure for upgraded nodes.

Findings

❌ Blockers

  • [src/Databases/DataLake/DatabaseDataLakeSettings.cpp:39] The revert deletes the onelake_bearer_token setting definition, but registerDatabaseDataLake still loads persisted database settings during ATTACH via database_settings.loadFromQuery(*database_engine_define, args.create_query.attach), and loadFromQuery passes them directly into impl->applyChanges without any compatibility shim (src/Databases/DataLake/DatabaseDataLake.cpp:1055-1057, src/Databases/DataLake/DatabaseDataLakeSettings.cpp:80-97). Any node that already has a DataLakeCatalog(... SETTINGS onelake_bearer_token = '...') metadata file from the reverted feature will now throw UNKNOWN_SETTING while attaching the database, so restart is still blocked.

  • Suggested fix: keep onelake_bearer_token as a deprecated attach-time no-op and continue masking it in SHOW CREATE / system tables, while rejecting it only on new CREATE DATABASE statements; or add a metadata migration that strips the persisted setting before loadFromQuery runs.

Tests
  • ⚠️ Add a focused attach/upgrade regression that uses metadata containing onelake_bearer_token, then restarts or ATTACH DATABASEes it and verifies the server still comes up. Without that, the compatibility path this revert needs is unproven.
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
  1. Preserve backward-compatible ATTACH behavior for persisted onelake_bearer_token metadata instead of turning it into UNKNOWN_SETTING.
  2. Add a regression test that proves upgraded nodes can still attach databases created with the reverted setting.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 7, 2026
DECLARE(String, onelake_client_id, "", "Client id from azure", 0) \
DECLARE(String, onelake_client_secret, "", "Client secret from azure", 0) \
DECLARE(String, onelake_bearer_token, "", "Pre-obtained bearer token for OneLake, scoped to https://storage.azure.com. The token is static and not refreshed, so a long-lived database must be recreated once it expires", 0) \
DECLARE(Bool, onelake_use_blob_endpoint, true, "Use the Blob endpoint (.blob.fabric.microsoft.com) for OneLake. When disabled, the DFS endpoint (.dfs.fabric.microsoft.com) is used instead", 0) \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing the onelake_bearer_token setting definition here is not backward compatible. registerDatabaseDataLake still calls database_settings.loadFromQuery(*database_engine_define, args.create_query.attach) during ATTACH, and loadFromQuery forwards every persisted setting into impl->applyChanges unchanged. That means any node that already has a DataLakeCatalog(... SETTINGS onelake_bearer_token = '...') metadata file from the reverted feature will now fail with UNKNOWN_SETTING before lazy init, so restart is still blocked. Please keep a legacy attach-time parser/no-op for this setting (and keep it masked in SHOW CREATE), or strip it from old metadata before loadFromQuery runs.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is fine. It was not part of a release, I am reverting it a few days after landing.

@clickhouse-gh

clickhouse-gh Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 85.60% 85.60% +0.00%
Functions 92.70% 92.70% +0.00%
Branches 77.90% 77.80% -0.10%

Changed lines: Changed C/C++ lines covered: 22/56 (39.29%) · Uncovered code

Full report · Diff report

@SmitaRKulkarni SmitaRKulkarni self-assigned this Jul 7, 2026
@SmitaRKulkarni
SmitaRKulkarni added this pull request to the merge queue Jul 7, 2026
Merged via the queue into master with commit 98ec4a5 Jul 7, 2026
172 of 175 checks passed
@SmitaRKulkarni
SmitaRKulkarni deleted the asya/remove_token branch July 7, 2026 08:23
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Jul 7, 2026
zeekay pushed a commit to hanzoai/datastore that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog 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.

3 participants