Repository navigation
Description
Description
On 4.2-dev, dynamic SQL S3 imports can fail during endpoint resolution when the SQL S3 options omit region, even when the CN process has a nonempty AWS_REGION. This prevents the stability workload from being prepared.
Environment
- Branch:
4.2-dev; reported imagecommit-a44c418resolves toa44c418aa644c4a77c5e6d06187ce973f18e07ce. The running binary SHA was not independently checked. - Distributed 2 CN, 1 DN, 3 LogService, 1 Proxy; 2026-11-18 01:57–02:00 UTC+8.
- Failed stability run 44135726801.
Observed behavior
The setup succeeded; the subsequent data preparation job failed all 10 TPCC table loads with S3: HeadObject ... Invalid region: region was not a valid DNS name. The remaining long-running workload jobs were skipped. The script generated SQL S3 options without a region; both CN pods currently expose a nonempty AWS_REGION (the incident-time value was not independently captured). There were also missing optional compression and format field warnings; their causal role has not been established.
Expected behavior
For a dynamic SQL S3 request with no explicit region, use the supported environment-region fallback while keeping caller-only credential isolation. An explicit region must take precedence.
Evidence and controls
- Existing historical 4.2 stability logs dated 2026-10-02 record 10/10 successful TPCC table loads using the same loader revision and byte-identical loader script and access configuration. The old directory name identifies source revision
28f1f02a89339def1b2572dbe07e98144a203167; its actual runtime SHA was not independently verified. - In the failed run, 10/10 table attempts reported the same endpoint error; these are not 10 independent runs. No isolated SQL reproduction, explicit-region control, data atomicity check, or real-cloud verification has been performed yet.
- In
a44c418,explicitAWSConfiguses only the SQL arguments' region, whereas the old source usedconfig.LoadDefaultConfig. This is consistent with the failure, but the precise values used by the failing requests and incident-time environment have not been captured.
Related and proposed regression coverage
Related: historical main issue #30528 and its merged fix #30533. The main fix is not an ancestor of this 4.2-dev image, and the 4.2 code lacks its region fallback. Verify whether a safe backport is applicable. Cover explicit-region precedence, AWS_REGION then AWS_DEFAULT_REGION, caller credential isolation, and an isolated public SQL load with success and failure/atomicity controls.
Activity
[4.2-dev] fix: preserve SQL S3 environment region fallback (#32877)
XuPeng-SH commentedon Nov 18, 2026
QA 交接补充(4.2-dev,不代表验收通过)
#32877 已于 2026-11-18 04:07:40 UTC 合入 4.2-dev,merge SHA
1920dc5c25758003315af6617b6ff6b37bf3fbf7,head272ba5c12fb309f26a219383af1a9ba0eb419438。本 issue 已由 @Ariznawlll 负责,保留现有 QA 指派,仅补交接证据,保持 open。修复动态 SQL S3 region fallback:显式 region 优先;bucket discovery 后仍未设置 region 时,依次读取 AWS_REGION、AWS_DEFAULT_REGION。仅恢复 region 配置,不启用环境凭据发现,继续保持 caller-only credential isolation。
已验证证据按来源区分(本巡检未自行运行测试):
72c43e9305d8355c940075e414f30eaf2e4112a6失败,含模拟 S3 transport 的同类 invalid-region 错误;补丁后 focused fallback/credential tests 三轮普通与三轮 race、SQL file-access group 三轮通过。待 QA 验证:在包含本 merge 的 4.2 实际二进制上,按原 stability 环境复跑未显式 region 的十张 TPCC 表导入,记录运行 SHA、实际 region 来源、行数及失败原子性;加显式 region 覆盖、AWS_REGION 优先于 AWS_DEFAULT_REGION、两者缺失与无 caller credentials 的拒绝控制,确认未退回环境凭据。真实云 S3、原始现场完整根因与全 fileservice 本地套件仍未闭环,不能仅凭模拟端点通过声称原事故已验收或整个稳定性工作负载通过。
已读 issue 完整评论、PR 全部讨论及审查,没有适用于本窄修复的当前已验证反例或未完成必要开发 follow-up;原环境未测由 QA 补齐,不据此阻止交接。
Ariznawlll commentedon Nov 18, 2026
Note
结论:official fix 有效(4.2-dev 实测通过),但原始 stability 环境未闭环,本 issue 建议保持 OPEN,等待原始 ten-table TPCC 导入复跑或确认 treated as resolved。
QA 独立复验结论(4.2-dev)
修复 PR #32877,merge SHA
1920dc5c25758003315af6617b6ff6b37bf3fbf7。实测环境
1920dc5c25...,经实例内select git_version()两次入口均返回1920dc5c25确认(8.0.30-MatrixOne-v1.3.0)。白盒(含修复源码,Go 1.26.5 darwin/arm64)
pkg/fileservice定向测试全部 PASS(普通 +-race各一轮):TestSQLFileS3UsesEnvironmentRegionWhenNotSpecified:SQL S3 无显式 region 时读取AWS_REGION;Authorization 为Credential=caller-key/.../us-east-2/s3/aws4_request,不含 ambient 凭据。TestExplicitAWSConfigRegionFallback:显式 region >AWS_REGION>AWS_DEFAULT_REGION。TestSQLFileCredentialsDoNotDiscoverServerIdentity:环境凭据不被发现,caller-only 凭据隔离保持。黑盒(公共 SQL,loopback S3 fixture,独立请求签名审计)
fixture 逐一记录每个请求的签名 region / 调用方身份,非黑盒猜测:
AWS_REGION=us-east-2,无 credential 环境变量 → 动态load_file()us-east-2AWS_DEFAULT_REGION=us-west-1→ 动态load_file()us-west-1region=eu-west-1+ 两个环境变量都设置 → 动态load_file()eu-west-1(优先级覆盖验证)LOAD DATA ... s3option(无 region 选项)us-east-2(HEAD+GET 均一致)load_file()Invalid region: region was not a valid DNS name(不猜值,符合预期)us-east-2HEAD 带 caller 签名(9,keep)保持不变(失败原子性)SQL dynamic object storage requires explicit credentials;既有行不变未验证边界(不可由 loopback fixture 替代)
建议
修复语义本身在实测中符合预期(显式 region 优先、
AWS_REGION→AWS_DEFAULT_REGION回退、caller-only 凭据隔离、失败原子性均验证通过)。剩余收尾项是原始 stability 十表导入复跑;如原始环境确认无法再复现失败,请以此为据评估关闭。回归候选:本地 S3 fixture 依赖端口/进程编排,不适合直接放入 motr,暂以本 comment 证据留档。
Ariznawlll commentedon Nov 18, 2026
Note
补充:按 QA 双分支规则,main 分支的同一修复语义已实测验证通过,回归用例已按规则同时提交到 motr main 与 motr 4.2-dev。
QA 补充复验:main 分支(#30533 修复语义)
承接上方 4.2-dev 复验,本轮在同一 loopback S3 fixture 与逐请求签名审计下验证 main 侧行为:
517e1695388cbaf1135238d5ab0c19a4556fb551;源码核对pkg/fileservice/aws_sdk_v2.go的explicitAWSConfig含同样的AWS_REGION→AWS_DEFAULT_REGION回退;实例内select git_version()返回517e169538。AWS_REGION=us-east-2→ 动态load_file()us-east-2,caller-key,无 ambientAWS_DEFAULT_REGION=us-west-1→ 动态load_file()us-west-1region=eu-west-1+ 两个环境变量齐设eu-west-1(优先级覆盖)LOAD DATA ... s3option(无 region 选项)us-east-2load_file()Invalid region: region was not a valid DNS name(不猜值)(9,keep)不变(失败原子性)SQL dynamic object storage requires explicit credentials),0 出站请求回归交付(按双分支规则提交 motr main + 4.2-dev)
用例:
14_issue_regression.issue_32876_sql_s3_region_fallbackMO_HOST/MO_PORT(防止默认端口误连无关实例——本轮 bring-up 中默认 6001 确实打到外部实例产生过一次假失败,该门控恰好消除了这类假判)与受控 S3 端点(MOTR_S3_REGION_TEST=1, MOTR_S3_ENDPOINT, MOTR_S3_BUCKET),否则显式 SKIP(77)。517e169538record 1/1、replay 1/1、repeat 2/2;4.2-dev1920dc5c25run 1/1、repeat 2/2,全通过、SKIP=0。7e9db8a):https://github.com/matrixorigin/motr/pull/358a968fe5,CI 4/4 SUCCESS):https://github.com/matrixorigin/motr/pull/363未验证边界不变:真实云 S3、原始 stability 十表 TPCC 导入、原 3-LogService/Proxy 拓扑;issue 保持 OPEN 等原始环境闭环。
Ariznawlll commentedon Nov 18, 2026
结论
测试通过。针对本 issue 的 4.2-dev 原始十表导入失败,合入修复后在重建的稳定性集群复跑成功。
关键证据
1920dc5c25758003315af6617b6ff6b37bf3fbf7;本次 2 CN / 1 DN / 3 LogService / 1 Proxy 集群镜像标签为commit-1920dc5。参见 稳定性运行 44269562761。Invalid region;只读查询十表均有数据,warehouse 为 10 行、district 为 100 行。上述为一次环境复跑,不代表十表逐行内容已比对。517e1695388cbaf1135238d5ab0c19a4556fb551的受控 S3 SQL 测试,覆盖显式 region 优先、环境回退、调用方凭据隔离及拒绝导入后既有行不变;本次未重复执行这些控制。待解决点