columnar: pass gcs_auth_mode through to the hub's DFS client - #11098
iosmanthus wants to merge 1 commit into
Conversation
build_dfs() built its S3 client with S3Fs::new(), which hardcodes an empty gcs_auth_mode. use_gcs_oauth() requires that field to be "oauth", so against a GCS endpoint the client never installed GcsOAuthDispatcher and fell back to the AWS credential chain instead. On GKE that chain ends at EC2 IMDS, which answers 404, so every columnar file read retried "Timeout getting credentials" forever and the MPP task never returned. The value was already there: run() calls Config::override_from_env() before build_dfs(), and that reads DFS_GCS_AUTH_MODE into the config. Only the handoff to the client dropped it. Both call sites now go through S3Fs::new_from_config(), which forwards gcs_auth_mode - the same constructor TiKV uses, which is why TiKV reads the same bucket without this problem. read_only and max_read_throughput are pinned to the values S3Fs::new() hardcoded, so the change stays limited to credentials. Signed-off-by: iosmanthus <myosmanthustree@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Hi @iosmanthus. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe DFS builder now creates S3 clients from cloned, read-only configurations. Environment overrides remain supported, and ChangesDFS read-only configuration
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The DFS client configuration preserves GCS OAuth settings in both construction paths, with no actionable merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. I hop through configs, neat and bright, Comment |
|
@coderabbitai[bot]: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: coderabbitai[bot], JaySon-Huang, yongman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/cherry-pick release-nextgen-202603 |
|
@yongman: once the present PR merges, I will cherry-pick it on top of release-nextgen-202603 in the new PR and assign it to you. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
/test pull-unit-test |
|
/retest |
|
@iosmanthus: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/retest-required |
|
/test pull-unit-test |
|
@iosmanthus: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/test pull-unit-test |
|
/retest-required |
What problem does this PR solve?
Issue Number: close #11095
Problem Summary:
Follow-up to #11096, which bumped kvengine for GCP support. No issue filed.
On a GCS-backed deployment the columnar read node starts, registers with PD as
engine=tiflash_compute, and decrypts its master key through GCP KMS — but noquery ever returns.
EXPLAINwithtidb_enforce_mpp=1produces a fullmpp[tiflash]plan, and executing it hangs forever.build_dfs()built the hub's S3 client withS3Fs::new(), which hardcodes anempty
gcs_auth_mode:The first two conditions hold; only
auth_modeis missing. SoGcsOAuthDispatcheris never installed and the client falls back to the AWScredential chain. On GKE that chain ends at EC2 IMDS, which answers 404, and
every columnar file read retries forever:
Note the snapshot fetch from TiKV succeeds — the hub gets as far as knowing
which columnar files to read, and only the object store read fails.
What is changed and how it works?
The value was never missing from the config.
run()callsConfig::override_from_env()beforebuild_dfs(), and that already readsDFS_GCS_AUTH_MODEintoConfig::gcs_auth_mode. Only the handoff to the clientdropped it.
Both call sites in
build_dfs()now go throughS3Fs::new_from_config(), whichforwards
gcs_auth_mode. That is the same constructor TiKV uses, which is whytikv-serverreads the same bucket with the same environment without hittingthis.
read_onlyandmax_read_throughputare pinned to the valuesS3Fs::new()hardcoded (
trueand0), so this change stays limited to credentials.Whether a configured
dfs.max-read-throughputshould apply to the hub is aseparate decision, deliberately not made here.
The env-overridden branch is fixed the same way. It is currently unreachable —
its condition needs
dfs_conf.s3_bucketands3_endpointto be empty, butoverride_from_env()has already populated them by then — but leaving the twobranches inconsistent would just re-plant the bug if that condition ever
changes. Removing the dead branch is out of scope for this PR.
Check List
Tests
Reproduced and verified on a GCP serverless cell (GKE,
us-east4, TiKV andTiFlash both reading one GCS bucket with
DFS_GCS_AUTH_MODE=oauth).Before this change, with an image built from #11096:
ALTER TABLE t SET TIFLASH REPLICA 1—information_schema.tiflash_replicareports
AVAILABLE=1within ~15s.SET SESSION tidb_enforce_mpp=1; EXPLAIN SELECT g, COUNT(*), SUM(v) FROM t GROUP BY g ORDER BY g;— fullmpp[tiflash]plan.retry loop quoted above, and keeps retrying after the client disconnects.
Ruled out as causes:
correct Workload Identity service account.
DFS_*environment, logs zerocredential errors over the same period.
variable; the
DFS_*andCSE_*sets are identical.Local
cargo check --locked --manifest-path hub-runtime/Cargo.tomlpassesagainst the
contrib/cloud-storage-enginerevision master pins(
9d4471a5). A rebuilt image has not yet been run on the cell — I will followup here once it has.
Side effects
None on AWS or on any deployment with a static
DFS_S3_KEY_ID: whengcs_auth_modeis not "oauth", or the endpoint is not GCS, or a key id is set,use_gcs_oauth()is false and the client is built exactly as before.Documentation
Release note
Summary by CodeRabbit