Skip to content

[Bug]: Preserve region fallback for SQL dynamic S3 - #30533

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
Ariznawlll:codex/sql-s3-region-fallback
Oct 18, 2026
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
Ariznawlll:codex/sql-s3-region-fallback

Conversation

@Ariznawlll

@Ariznawlll Ariznawlll commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Closes #30528

What this PR does / why we need it:

SQL dynamic S3 providers intentionally avoid discovering credentials from the server environment. That path also stopped inheriting the AWS SDK's environment-based Region fallback, so configurations without an explicit Region failed before reaching S3.

When s3-opts omits Region, use AWS_REGION, then AWS_DEFAULT_REGION; an explicitly configured Region still takes precedence. This restores non-secret Region compatibility without re-enabling ambient credential discovery. Regression tests verify the signed request uses the expected Region and caller-supplied credentials.

Validation:

  • CI run 39139192516: UT, SCA, and BVT checks passed.
  • Focused file-service validation passed: 465 tests, 6 existing skips, plus three signed-request boundary scenarios. No live AWS run was performed.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH

XuPeng-SH commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · done

Commit: 7c6a2c527beef5d3bb21aedcb438bd6b7da7c72c

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

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.

mo-bot review · mo-bot-xupeng · review

Commit: 7c6a2c527beef5d3bb21aedcb438bd6b7da7c72c

Assessment: approve

Reviewed the complete two-file delta and its SQL/S3/STS callers. Region fallback preserves explicit-region precedence and credential isolation. No actionable findings.

Model: gpt-6-astra / xhigh

Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0

Validation:

  • Receipt/log mapping retained in /home/xupeng/.local/state/mo-bot/jobs/6b79a7f5c6927bccf43005b0/attempt-1/validation-index.json. Final integrity checks confirmed the pinned checkout remained clean.

  • Built native prerequisites from 192 matched candidate inputs. Isolation preflight, formatting and whitespace checks passed.

  • 12 focused tests and three additional signed-request boundary scenarios passed. Both new regression tests failed against the pre-fix implementation as expected.

  • Package selections reconciled: 465 tests passed and six existing tests skipped. The initial aggregate timeout and interrupted run were not counted as package passes; successful recovery selections closed the remaining coverage.

Limitations:

  • No live SQL/frontend or AWS-cloud run; validation exercised the production SQL file-service factory and SDK signing, plus the existing local MinIO suite.

  • The frozen evidence omits issue #30528's body; its contract was assessed from the PR description. CI status summaries were not treated as log-verified execution.

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@mergify mergify Bot added kind/bug Something isn't working queued labels Oct 18, 2026
@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-18 17:11 UTC · Rule: main · triggered by rule Automatic queue on approval for main
  • ✅ Checks passed · in-place
  • ✅ Merged — 2026-10-18 18:10 UTC · at f11dd8c5d700f215922835f314ea18d32471f482 · squash

This pull request spent 58 minutes 41 seconds in the queue, including 51 minutes 3 seconds running CI.

Required conditions to merge

@mergify
mergify Bot merged commit f11dd8c into matrixorigin:main Oct 18, 2026
@mergify mergify Bot removed the queued label Oct 18, 2026
mergify Bot pushed a commit that referenced this pull request Nov 18, 2026
## What type of PR is this?

- [x] BUG
- [x] Test and CI

## Which issue(s) this PR fixes:

Fixes #32876

## What this PR does / why we need it:

Backports the region fallback from main PR #30533 to `4.2-dev`. A dynamic SQL S3 request without an explicit region resolves `AWS_REGION` first and then `AWS_DEFAULT_REGION`; an explicit region always wins. This reads only region configuration and does not enable ambient credential discovery.

The 4.2 stability data preparation run failed to load ten TPCC tables with an S3 HeadObject invalid-region error. The loader omitted a region. A controlled end-to-end reproduction in that environment is still needed before confirming the original incident's complete cause.

## Validation

- On the unpatched 4.2-dev base `72c43e9305d8355c940075e414f30eaf2e4112a6`, the two backported tests failed, including the same invalid-region error from a simulated S3 transport.
- After the patch, the focused fallback and caller-credential tests passed three runs and three race runs; the SQL file-access test group passed three runs.
- Real cloud S3, public SQL end-to-end, the original ten-table stability import, and the complete fileservice suite remain unverified. Some fileservice tests use shared `/tmp` socket paths, so the complete suite was not run on the shared host.


Approved-by: XuPeng-SH <[email protected]>

This branch was previously deployed

1 inactive deployment
ci — df1c6ab5 Deployed Oct 18, 2026 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: SQL 动态 S3 导入在 Region 未显式设置时失败

3 participants