Repository navigation
Description
Summary and scope
A failed CN protocol-capability probe loses its transport error when the parent statement is still active. Distributed IVF IndexSearchScan then returns ErrNotSupported / “requires MORPC protocol version 111 on every CN”, indistinguishable from a genuinely old peer.
This error-classification / lost-cause defect is reproduced with the real pkg/sql/compile implementation and an existing query-client fault-injection fixture. It is not a request to bypass the protocol guard or dispatch to an unverified peer.
The investigation was prompted by 11 failed queries in Main's Wiki 10M PRE benchmark. The nightly has exactly this public error. The underlying reason its capability check failed is not yet established: the report does not claim a protocol-111 serialization regression, prove that its 11 failures were all probe timeouts, or attribute them to HAKeeper based only on temporal correlation.
Versions and environment
- Observed nightly MO subject:
e8b3ed7f21c2b1966d74814adaa2bcd96d8c129f. - TKE Main Family, 1 TP CN + 2 AP CN; namespace
mo-main-family-38757675628-1. - Collected resource artifact records all three CNs with the same image digest,
sha256:bf735f52ce7f7501ad52e406e5abfba6b88b6433c189ec46ae4d300b801a4a8d, and restart count 0. This is a snapshot, not proof of every peer's effective protocol gate at failure time. - Inspected current main:
2cf7684062e71eece7af4ed74cabf37e0ca3a301(2026-10-16); the relevant probe and IVF rejection paths remain present. The nightly workload has not been rerun on this head. - Native diagnostic test: Linux/amd64,
bd9c69f8fcff893bc23c029149f8d915cef11191, using repositorymo-cgo-testand matching native artifacts.expression_protocol.go,compile.go,vector_scan_protocol.goand the reused test-fixture files are byte-identical to the incident revision. Only a diagnostic test was added through a Go overlay; production code was unchanged.
Observed nightly failure
Main Wiki job / original runner output
The l2_only / pre / round 1 result reports:
expected=10000 completed=10000 failed=11 connection_errors=0
failure_samples: query_id 179,170,180,173,182,141,183,185,191,186,193
reason: OperationalError
Here completed counts terminal requests, including failures. The runner's zero connection_errors does not prove that internal RPC probing was healthy.
Bounded server-log collection found 11 matching errors on AP CN nightly-regression-dis-ap-cn-dscb9, at 2026-10-15 18:59:50.239–18:59:51.637 UTC (Oct 16 02:59:50–02:59:51 UTC+8):
not supported: index search scan requires MORPC protocol version 111 on every CN
Other Wiki modes subsequently emitted zero-query-error summaries. The collected CN image/restart snapshot does not show a rolling mixed-version deployment. Neither observation establishes the exact failed probe response or cluster-discovery state.
Evidence artifacts on that run:
test-control-product-receipt-runner-main-vector-wiki-38757675628-1tke-family-weekly-shadow-1x2-resource-38757675628-1
Confirmed code mechanism
-
remoteWorkerProtocolVersionreturns cluster-discovery /GetProtocolVersionquery-client errors. -
remoteWorkersSupportProtocoluses a five-second child probe context, but handles any probe error as:if err != nil { return false, parent.Err() }
A child-probe timeout or connection failure does not necessarily cancel the statement's parent. In that case this becomes
(false, nil)and discards the original cause. -
compileIndexSearchScanandconstrainRequiredIVFWorkersinterpret this as unsupported protocol and produce the same public error as a confirmed old peer. The send-time validation also shares the helper.
Failing closed is correct. Reporting “the peer does not support this protocol” after a failed observation, with no preserved failure cause, is the defect. It hides the actionable distinction between version incompatibility and an unavailable/timed-out capability check.
Deterministic native reproduction
The existing vectorPlacementCompile fixture sets both coordinator and successful peer responses to the required protocol. Inject an error only in its GetProtocolVersion transport; do not alter the production validator.
Add this diagnostic test to pkg/sql/compile at the test revision above:
package compile
import (
"context"
"testing"
"github.com/matrixorigin/matrixone/pkg/common/moerr"
"github.com/matrixorigin/matrixone/pkg/sql/colexec/vectorscan"
"github.com/matrixorigin/matrixone/pkg/vm/engine"
"github.com/stretchr/testify/require"
)
func TestCapabilityProbeMustRetainFailureCause(t *testing.T) {
workers := engine.Nodes{{Id: "b", Addr: "b:6001"}, {Id: "a", Addr: "a:6001"}}
t.Run("helper", func(t *testing.T) {
c, client := vectorPlacementCompile(t, workers)
client.customResponse, client.sendErr = true, context.DeadlineExceeded
ok, err := remoteWorkersSupportProtocol(c.proc, workers, vectorscan.IndexSearchScanProtocolVersion)
require.False(t, ok)
require.NoError(t, c.proc.Ctx.Err())
require.ErrorIs(t, err, context.DeadlineExceeded) // currently fails: err == nil
})
t.Run("public_placement_error", func(t *testing.T) {
c, client := vectorPlacementCompile(t, workers)
client.customResponse, client.sendErr = true, context.DeadlineExceeded
scopes, err := c.compileIndexSearchScan(vectorPlacementNode())
t.Cleanup(func() { ReleaseScopes(scopes) })
require.Error(t, err)
require.Empty(t, scopes) // rejection must remain fail-closed
require.False(t, moerr.IsMoErrCode(err, moerr.ErrNotSupported)) // currently fails
})
}GOMAXPROCS=4 .agents/skills/mo-dev/scripts/mo-cgo-test \
-p=2 -v -count=1 -timeout=90s \
-run '^TestCapabilityProbeMustRetainFailureCause$' ./pkg/sql/compileActual diagnostic run used equivalent assertions plus successful-probe and actual-old-version controls:
successful_probe_control: PASS
actual_old_version_control: PASS
transport_timeout_cause:
supported=false returned_error=<nil> parent_error=<nil> probe_calls=1
FAIL: Expected context deadline exceeded in error chain, got nil
placement_preserves_transport_cause:
placement_error=not supported: index search scan requires MORPC protocol version 111 on every CN
is_not_supported=true probe_calls=1
FAIL: transport failure classified as unsupported capability
The diagnostic was repeated with -count=3: both controls passed and both lost-cause assertions failed on all three executions. The unchanged TestIndexSearchScanPlacementRequiresProtocol passes all seven existing subtests, including probe failure. It currently intentionally groups probe failure and actual protocol incompatibility under the same assertion, so a green existing test does not validate error-cause accuracy. The diagnostic failure above is an assertion failure against real code, not a compile/link failure. Fault injection demonstrates the error mapping, not an end-to-end reproduction of the nightly network/cluster condition.
Expected behavior / fix boundaries
- Keep genuinely old peers rejected and keep unknown peers fail-closed wherever this execution path requires it.
- Preserve the probe failure/cancellation cause and distinguish it from an observed version below the required floor. Include a bounded worker identifier/required version if practical; do not dump full SQL/vector values.
- Do not blindly replace the shared helper's policy without reviewing expression callers: some intentionally choose a safe local execution path for unknown capabilities. Preserve those valid fallbacks and response cleanup.
- Cover healthy probes, actual old peers, probe-local timeout with a live parent, transport failure, parent cancellation, missing response/discovery and send-time revalidation.
The nightly's underlying availability trigger still needs a failed-peer/probe-cause observation. Changing this diagnostic alone must not be presented as fixing all 11 nightly query failures.
Duplicate check / related issues
- [Bug]: Fresh 1TP+2AP TKE cluster rejects persisted-expression DDL at local catalog admission #29333 concerns persisted-expression catalog DDL admission, not this IVF execution error mapping. Both involve capability observations, but the failing boundary is different.
- [Bug]: 10M IVFFlat workload intermittently closes RPC/backend connections #27757 tracks earlier 4.2 Wiki RPC/backend closure; it does not establish the cause of this main protocol error.
- [Bug]: query_client morpc backend missing read timeout causes goroutine leak on unresponsive CN #25191 concerns query-client read timeout/leaked requests. This report does not establish that mechanism in this run.
Searched current open/closed Issues and relevant PRs for the helper name, capability probe, IVF and protocol-version symptoms. No existing issue specifically covering this demonstrated lost-cause / false-incompatibility classification was found.
Activity
fix(compile): preserve capability probe errors (#30516)
XuPeng-SH commentedon Oct 18, 2026
本轮合并后实测已覆盖本 issue 明确限定的 main capability-probe 错误分类/丢失原因 范围,转 Ariznawlll 验收。
环境:Linux/amd64、Go 1.27.1、按当前源码新构建 CPU/CGo;main 完整 SHA
4226537e5094995155eab9c2a883db649ff7b95b(包含 #30516)。生产源码未修改。新执行证据:
TestCapabilityProbeMustRetainFailureCause通过独立 Go overlay 加入,helper 与 public-placement 两个原始反例 normal + race 均通过,保持 live parent、拒绝空 scopes、保留context.DeadlineExceeded并验证不是 ErrNotSupported。TestIndexSearchScanPlacementRequiresProtocol,healthy、old worker/coordinator、unknown worker、transport/deadline、parent cancellation、probe 中取消、forced-local 九个控制全部通过。两条命令均 exit 0。TestIndexSearchScanRefusesOlderCN通过:健康 SQL 与旧协议拒绝。它是当前 CN 广告旧协议控制,不是假称运行旧二进制。原始复现命令(normal 删除
-race):.agents/skills/mo-dev/scripts/mo-cgo-test -race -p 1 -count=1 -v -timeout 3m \ -overlay /workspace/work/pr-audit-continue18/capability-overlay.json \ -run '^(TestCapabilityProbeMustRetainFailureCause|TestIndexSearchScanPlacementRequiresProtocol)$' ./pkg/sql/compile原始日志与真实退出码:
logs/main-original30408{,-race}.log/.exit、main-probes.log、main-race.log和main-additional.log,位于/workspace/work/pr-audit-continue18。范围限制:未复跑原 Wiki 10M TKE 部署,未证明其 11 个失败的底层可用性触发原因已消失;本 issue 正文已明确将该触发原因排除在诊断分类缺陷之外。原始 mapping 复现是 query-client fault injection,不是实际等待五秒的超时注入。本轮未宣称这些限制已验证。4.2-dev
35273bcd6a5cfa9468bcf7ca4031fe17560b5ab1没有该vectorscan/compileIndexSearchScan/remoteWorkersSupportProtocol路径;不将 main 的结果外推为 4.2 修复。Ariznawlll commentedon Oct 18, 2026
测试版本
main,完整 commit4226537e5094995155eab9c2a883db649ff7b95b(已含修复 PR #30516)。原问题验证
针对正文限定的「capability probe 失败却丢失原错误、误报旧 MORPC 协议」执行修复后的真实
pkg/sql/compile测试。注入GetProtocolVersion的context.DeadlineExceeded,同时保持父 statement context 有效:3/3 均保留原错误链(errors.Is成立),不再返回ErrNotSupported;IndexSearchScan仍拒绝分发并返回空 scopes。未将此结果解释为原 Wiki 10M 夜间任务中 11 次查询失败的底层可用性原因已消失。Happy Path 覆盖
-count=3通过;后者不是运行旧版二进制。Unhappy Path 覆盖
白盒验证
go test -race -count=3 -run '^(TestIndexSearchScanPlacementRequiresProtocol|TestExpressionProtocolFailedResponsesAreReleased|TestExpressionProtocolDiscoveryFailure|TestRemoteExpressionPlacementProbeFailure|TestVectorScanPartitionTransportAndRollback)$' -timeout=12m ./pkg/sql/compile:通过。go test -count=3 -run '^TestIndexSearchScanRefusesOlderCN$' -timeout=12m ./pkg/tests/sqlintegration/multicn:通过。go test -race -count=1 -timeout=20m ./pkg/sql/compile:整个 package 通过。回归测试
PR #30516 已把 capability-probe 错误分类和旧协议控制纳入 MatrixOne Go UT/双 CN 集成测试。此处依赖内部 query-client 故障注入,不是稳定可由外部 SQL 触发的场景,故未向 MOTR 强塞假定性的成功用例;原 Wiki 10M 分布式规模/真实探测失败原因仍未复跑、未判定。
测试证据
测试结论
测试通过。