Repository navigation
Description
Description
When plain HTTP is not explicitly enabled, CREATE ICEBERG CATALOG accepts an http:// REST URI and persists the unusable catalog in mo_catalog.mo_iceberg_catalogs. HTTPS enforcement happens only when the catalog is later used.
This violates the Iceberg catalog configuration contract: insecure catalog URIs should fail before a local catalog record is committed.
Environment
- Branch:
main - Commit:
1f9e501594509fb5d2e0284833faf8c3426e2285 - Deployment: local 1 CN / 1 TN / 1 Log, standard DISK-V2 launch;
[cn.frontend.iceberg] enable=true;MO_ICEBERG_ALLOW_PLAIN_HTTPunset
Steps to reproduce
DROP ICEBERG CATALOG IF EXISTS bad_http_1;
CREATE ICEBERG CATALOG bad_http_1 WITH (
'type'='rest',
'uri'='http://127.0.0.1:65530/iceberg',
'warehouse'='s3://x1',
'auth_mode'='none'
);
SELECT name, uri
FROM mo_catalog.mo_iceberg_catalogs
WHERE name='bad_http_1';Repeat with bad_http_2 and bad_http_3.
Actual behavior
All three CREATE ICEBERG CATALOG statements succeed and all three HTTP URIs are committed:
bad_http_1 http://127.0.0.1:65530/iceberg
bad_http_2 http://127.0.0.1:65530/iceberg
bad_http_3 http://127.0.0.1:65530/iceberg
When an existing HTTP catalog is used for a scan, MO then returns the expected runtime error:
ERROR 20300 (HY000): ICEBERG_CONFIG_INVALID: Iceberg REST catalog URI must use https unless plain HTTP is explicitly enabled
Thus the HTTPS policy exists, but the DDL path does not apply it before persistence.
Expected behavior
CREATE ICEBERG CATALOG must reject http:// with ICEBERG_CONFIG_INVALID when MO_ICEBERG_ALLOW_PLAIN_HTTP is unset, and must leave no catalog row behind.
Stability and controls
- Reproducer: 3/3
- Control: an otherwise equivalent
https://catalog.example.com/restcatalog is created successfully; version changes from 1 to 2 afterALTER - Runtime HTTPS gate control: an HTTP-backed scan is rejected with
ICEBERG_CONFIG_INVALID - Failure atomicity/data check: failed validation is expected to create zero rows, but the reproducer creates one persistent row per attempt; explicit cleanup returns the matching catalog count to 0
- Service health:
SELECT 1and native catalog DDL remain healthy; no panic/restart
Evidence
- Local output:
/private/tmp/iceberg-full-http-gate-3round.out - Server version:
git_version() = 1f9e50159
Code analysis
Confirmed split in validation paths:
pkg/iceberg/catalog/rest.gorejects plain HTTP inrestURLunlessallowPlainHTTPis enabled.pkg/frontend/iceberg.gopersistsCREATE ICEBERG CATALOGthroughInsertCatalogSQLwithout invoking the REST URI HTTPS validation.
The result is deferred validation: DDL commits a catalog definition that the runtime client will always reject under the same server configuration.
Regression coverage
After the fix, add a stable BVT/embedded SQL case that runs with the HTTP development override disabled and asserts:
- HTTP
CREATE ICEBERG CATALOGreturnsICEBERG_CONFIG_INVALID. - The catalog is absent from
mo_catalog.mo_iceberg_catalogs. - HTTPS catalog creation still succeeds.
- Inline secrets remain rejected/redacted.
Related
- Feature validation source: [Feature Request]: Support External Iceberg Tables #23359
- External object-read failure found in the same feature validation: [Bug]: Spark-generated Iceberg Parquet table fails to read even with one row #27196
Activity
fix(iceberg): validate REST catalog URI before persistence (#27226)
Ariznawlll commentedon Aug 17, 2026
测试版本
最新
main:484e1969531e7fbf7219b20e34d7ef23e110560b;本地 DISK-V2 单 CN + TN + LogService,Iceberg REST catalog 已启用,plain HTTP override 未设置。原问题验证
原问题是 REST catalog 使用 HTTP URI 时仍被写入 catalog 元数据。最新 main 对 HTTP URI 在持久化前返回
ICEBERG_CONFIG_INVALID: Iceberg REST catalog URI must use https unless plain HTTP is explicitly enabled,查询mo_catalog.mo_iceberg_catalogs不存在该名称;HTTPS URI 作为正向控制可以创建并持久化。Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
修复提交
1eda266已包含在测试版本中。回归测试
该场景依赖 MatrixOne Iceberg 配置,未加入默认 MOTR SQL;已在 MOTR PR #113 覆盖矩阵中路由到专用 Iceberg REST E2E。普通 MOTR 运行不应在未配置 REST catalog fixture 时伪造该基线。
测试证据
HTTP case 返回上述配置错误且 catalog 行数为 0;HTTPS control 创建成功并可在
mo_catalog.mo_iceberg_catalogs查询。测试结论
测试通过。
fix(iceberg): validate REST catalog URI before persistence (matrixori…
fix(iceberg): validate REST catalog URI before persistence (matrixori…
fix(iceberg): validate REST catalog URI before persistence (matrixori…