You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: MongoDB conversion failures do not update conversion error metric #28341
MongoDB external-table conversion failures are returned to the client, but mo_mongodb_conversion_errors_total does not increase. This makes the conversion-error metric unable to reflect a real strict BSON-to-MatrixOne conversion failure.
Environment
Namespace: mo-search-commit-4fdb9e916-20260907 on TKE host 129
Please increment the conversion-error metric for business BSON conversion failures, or explicitly document that this metric only counts tolerated/limited conversion errors and provide a separate metric for strict conversion failures. The metric should remain bounded and must not expose query values or credentials.
Safety checks
Cursor open/close counts matched and the checked-out connection gauge returned to zero.
External-table baseline remained COUNT(*) = 5, SUM(measurement) = 74.
Activity
Ariznawlll commentedon Sep 8, 2026
已在最新官方 main
f72ca9efbeb3a7c673701e4a135cc6670c33cfde本地复核:strict 转换查询按预期返回转换错误,但conversion_errors_total为 before=26、after=26,仍未增长;同轮 try_null 转换错误指标可从 25 增到 26。结果与当前 issue 描述一致。逐项证据见 Ariznawlll/mo-test-reports#26,commitc2152ec。Ariznawlll commentedon Sep 8, 2026
测试版本
main585a38efd152fadf216c8675b7b997a35ca8deb1原问题验证
strict BSON-to-BIGINT 转换错误按预期返回,但
mo_mongodb_conversion_errors_total仍为before=26, after=26,未增长。Happy Path 覆盖
try_null转换错误的指标由25 -> 26,证明采集和读取路径有效。Unhappy Path 覆盖
白盒验证
当前 converter 仅在
try_null分支增加该 counter;strict 分支直接返回错误,和运行结果一致。回归测试
同 SHA 官方 E2E 26/26;扩展矩阵 157 PASS / 1 FAIL,唯一失败即本 Issue。
测试证据
扩展矩阵与相关 Issue 汇总
测试结论
测试不通过。
fix(mongodb): count strict conversion errors (#28470)
fix(mongodb): count strict conversion errors (matrixorigin#28470)
fix(mongodb): count strict conversion errors (matrixorigin#28470)
fix(mongodb): count strict conversion errors (matrixorigin#28470)
Ariznawlll commentedon Oct 9, 2026
测试版本
maindca6ffc2bf21036627b221b67f05943fbe458cf0原问题验证
Mongo 源文档中把字符串
"bad"投影到 BIGINT 外表列,在 strict 转换模式下查询返回预期转换错误,同时mo_mongodb_conversion_errors_total每次增加 1。三次独立 E2E 运行均通过;同一轮连续三次 strict 失败可观察到计数0→1→2→3。这与此前 strict 报错但计数不增长的复现结果不同。Happy Path 覆盖
try_null模式继续累计错误,计数从 3 增至 8;验证修复 strict 分支没有破坏既有容错计数。Unhappy Path 覆盖
白盒验证
聚焦 Go UT
TestConverterConversionErrorMetricCountsStrictAndTryNull在同一 main 上重复 3 次通过;它分别断言 strict/try_null 分支的计数行为。测试源码。回归测试
此项不加入默认 MOTR:公开 SQL 的 Mongo 外表测试必须有已授权 Mongo ReplicaSet、外部认证配置和 CN metrics endpoint;默认 MOTR 环境没有这些前提。把 SQL 占位文件标记 skip 不会覆盖指标缺陷。保留 MatrixOne 聚焦 UT 和专用 Mongo E2E 作为实际回归层。通用 Mongo E2E 中另有 JSON cast 预期差异,与本次指标用例无关;不宣称通用套件全绿。
测试证据
测试结论
测试通过。