Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Searched open/closed issues for allocation account invariant failure, allocation account admission is suspended, site=48, and runtime-filter/allocation/UPDATE cleanup combinations. #31064 concerns a materialized-CTE ownership defect; #31089 concerns a prepared window. Neither is established as the cause of this simple UPDATE/failure-path observation. #32515 is the investigation that exposed this separate failure, not a duplicate or a claimed reproduction of its allocator zero-row FATAL.
Branch Name
4.2-dev, observed in an isolated experiment. Current main and current 4.2-dev heads have not been runtime-verified for this trigger.
Commit ID
a7bc2008e9236708fee0328376f2c2c6b6f0d3fc
Other Environment Information
- Linux amd64; isolated Docker network and directories on a development server, not a production cluster.
- Exact image:
ccr.ccs.tencentyun.com/matrixone-dev/matrixone@sha256:56a64cbbb7a86ada87c4e1af656791be329714ef0fe60e3ecae1aa8955432ee8. - One LogService, one TN, three CNs. CNs: 2 CPUs/2GiB each;
GOMAXPROCS=2. Survivor CN:GOMEMLIMIT=256MiB,GODEBUG=gctrace=1; other services: 1400MiB soft heap limit. No artificial filler allocation. Shared storage uses DISK-V2 in this fixture, not COS. - One million synthetic rows; 100 concurrent clients; SQL
PREPARE/EXECUTE(not binary COM_STMT_EXECUTE). - A peer CN was deliberately paused to exercise ordinary failure cleanup while the other CN continued serving. Reader/partition-state logging was enabled only on the survivor using existing diagnostic fault points; no allocation-failure or row-corruption injection was enabled.
- These conditions differ from the original [Bug]: incrservice: 4.2 AP CN exits on zero-row allocator reads during concurrent primary-key UPDATE #32515 incident. This is one observed run, not a deterministic minimal reproducer or proof of a recent regression.
Actual Behavior
During concurrent UPDATE after a peer pause, an UPDATE on the surviving CN terminates with an allocation-account invariant error. The remaining charge is 48 bytes, one allocation, far below the account's 107,374,182-byte limit. Subsequent statements and new connections are rejected by allocation admission, not by OOM or invalid credentials.
UTC, 2026-11-11:
| Time | Observed event |
|---|---|
| 14:40:29 to 14:41:11 | Initial workload completes 78,471 successful UPDATE requests, 0 request errors. A separate subsequent business-table cardinality query times out after 15 seconds, so full business correctness is not claimed. |
| 14:41:29.804 | Peer CN paused; ongoing phase routes the workload to the survivor. |
| 14:42:13.344 | Survivor reports backend connection errors. |
| 14:42:21.745234 | UPDATE reports the terminal allocation-account error below. |
| 14:42:21.746144 to 14:43:06.889330 | 418 server error messages with allocation account admission is suspended; these are repeated consequences, not 418 independent root defects. 23 independent observer connection attempts fail with 1045 containing the same admission error. |
| 14:43:07 onward | Experiment intentionally stopped and evidence preserved. Peer unpaused for cleanup. All five containers end with exit 0, no OOMKilled. This does not establish natural recovery time after the error. |
allocation account invariant failure:
handle=1584842932251 used=48 peak=33112 limit=107374182
owner=1 site=48 live-allocations=1
execute p using @a,@b
-- prepared SQL: update test01 set a=? where b=?
-- parameters: a=1083941, b=674301
statement_id=01a1cb0f-538e-7f4a-a5a0-5f00d873fdc4
txn_id=c4682edd44bdcba418e70497ef750ae2
snapshot=1794408141622557426-1
The server query-trace record contains this statement and error. Later existing sessions receive admission errors, and new observer connections receive:
Access denied for user <test-tenant>:admin.
allocation account admission is suspended
The survivor emitted 2,408 parsed gctrace records during approximately 175 seconds; maximum sampled post-GC live heap was 719MB. Memory pressure was real, but 48 bytes is a terminal ownership/lifecycle charge, not an exhausted 107MB account and not proof of a 48-byte physical memory leak.
Expected Behavior
Peer unavailability may fail affected statements, but query cleanup must retain/release ownership consistently. A failed UPDATE should not leave a terminal-account violation that blocks unrelated future statements or connections on the survivor. Do not fix this by suppressing the invariant, resetting accounting, or silently accepting incomplete results.
Steps to Reproduce
Observed bounded experiment; the minimal necessary conditions and reproducibility rate are still unknown:
- Start the exact image in the isolated multi-CN topology above. Create an independent test tenant on the TP CN, then create the table on an AP CN:
CREATE DATABASE incr32515;
USE incr32515;
CREATE TABLE test01(a BIGINT AUTO_INCREMENT PRIMARY KEY, b INT UNIQUE KEY);
INSERT INTO test01 SELECT result,result FROM generate_series(1,1000000) g;
PREPARE p FROM 'UPDATE test01 SET a=? WHERE b=?';- Use 100 clients and distinct increasing
avalues starting at 1000001, with deterministic random existingbvalues in 1..1000000. Each request sets the two session variables and executesp. Baseline traffic is split between two AP CNs for 40 seconds. - Start the next phase with all traffic on the survivor. Pause only the owned peer CN after initial phase progress. Preserve server logs, container state and GC logs; do not pause TN or the surviving CN.
- Observe the UPDATE terminal error followed by admission rejection. Stop on this anomaly; do not count the interrupted test as a successful [Bug]: incrservice: 4.2 AP CN exits on zero-row allocator reads during concurrent primary-key UPDATE #32515 validation.
Additional information
Confirmed source facts, not a complete leak root cause
- HashBuild allocation sites: the
iota + 44sequence mapssite=48toHashBuildAllocationSiteRuntimeFilterPayload, with owner 1. This narrows the outstanding charge to the runtime-filter/key-payload allocation domain; it does not identify which reference failed to release. - Payload publication attaches a release callback to a runtime-filter message. There are also membership-key publication paths using the same site.
- Message destruction is expected to invoke the release once. Statement cleanup drains its board and clears registered owners before completing the account.
- CompleteTerminalWithError publishes nonzero terminal state as a tombstone and sets
r.suspended=true; later physical release may drain it. This explains the observed admission rejection, not why the 48-byte charge survived the terminal boundary.
Boundaries and preservation
- No allocator
BUG: read incr record invalidwas observed. All 98 successful metadata point/full observations found the target row; 23 later observers could not connect and are not counted as passes. These are separate RC statements, not same-snapshot proof. - No production SQL/data was used. Main was not tested; no introducing PR has been identified. Do not infer a permanent leak from the approximately 45-second observed rejection window.
- Driver, config, complete stopped data directory, all service logs, diagnostic logs, GC output, and container receipts are preserved. Archive SHA256:
4c9f1b57de6d27953577b539615e5ff50a9257a0ca075c0f0d29372389f1e283(209 regular files). Local record:docs/codex-handoffs/incr-fatal-20261111/validation/round5/. - Next bounded discriminator: retain the exact runtime-filter/key-payload owner/refcount and board/attempt generation at cancellation, compare normal completion vs peer-unavailable cleanup. Establish whether the retained charge is an unclosed owner, incorrect terminal ordering, or a delayed release before changing shared allocation policy.
Activity
fix: reset int hashmap scratch before encoding (#32647)
Ariznawlll commentedon Dec 1, 2026
测试版本
efbab93eb361eabddf1fb5c012e93bec094660c1;本地精确构建BUILD_42_EFBAB_PASS,mo-service SHA-256c2bcf9dfbb173b8b01579df7b04626aaaffee929ea9ea47b338563a890ba2a10。git_version()确认完整 efbab SHA。survivor CN 使用GOMEMLIMIT=256MiB和gctrace=1,Log/TN及其余两个 CN 使用 1400MiB。原问题验证
严格保留原规模:创建 1,000,000 行
test01,运行 100 个 SQLPREPARE/EXECUTEUPDATE clients;40 秒 baseline 后对 peer CN 执行真实SIGSTOP60 秒,再SIGCONT恢复。未用缩小规模的机制测试替代。当前 efbab 下完整原场景 PASS,未出现allocation account invariant failure或allocation account admission is suspended。Happy Path 覆盖
a、b均为 1,000,000 distinct,b范围为 1–1,000,000。Unhappy Path 覆盖
b被更新,精确等于 successful distinct-key set 与 attempted distinct-key set;a=b剩余 947,316 行、a>1000000为 52,684 行,完整基数、唯一性和键集合关系全部通过。fatal_allocation_messages=[]、errors={};peer pause 期间没有把语句失败改写为成功。白盒验证
核对当前 efbab 的
statementAllocationAttempt生命周期:terminal 阶段关闭并 drain coordinator board,逆序清理全部 allocation owners,再通过CompleteTerminalWithError完成统一结算;finishAllocationAccountAttempt对 statement attempt 做恰好一次收尾。未修改 MatrixOne 产品源码,也不据此单独推断某一个修复提交。回归测试
独立 matrixorigin/motr#400,head
abd53b5de695aca5a7c32129b3f3c58171c7f126;固定 efbab,包含同样的五进程拓扑、原始内存限制、1M 行、100 clients 和真实 peer pause。定向original-three-cn-peer-pause-42与 offline 4 项均 SUCCESS(run 46595062601)。CI 同样完成 1M 行、100 clients、三 CN 与 60.000 秒 peer pause:26,857/26,857 UPDATE 成功,survivor 19,692、observer 117,26,504 个 changed=successful=attempted keys,零语句错误及 allocation/admission fatal。测试证据
本地证据:
qa-32568/42-efbab-original-exact6/,包含三 CN SHA/DDL readiness、完整驱动输出、original-result/result.json、五进程日志与 SHA256SUMS;runnerexit=0。早期缺配置、辅助SUM(BOOL)、Counter/Decimal 报告及最终核验客户端读取超时均保留为 QA 夹具历史,没有写成产品 PASS golden,也未用于替代本轮完整结果。测试结论
当前 efbab 下原规模问题验证、Happy/Unhappy Path、白盒核对及独立 MOTR 原规模回归均通过,复测结论为 PASS,关闭本 Issue。