Repository navigation
Description
Description
The internal sys:mo_logger pipeline fails to insert statement records into system.statement_info during Wiki 10M BF16 EXPLAIN ANALYZE diagnostics. The generated LOAD DATA INLINE is rejected because a TEXT value exceeds the destination length limit of 65,535.
The same failure was observed in two separate runs on two MatrixOne main commits. A subsequent isolated local reproduction on the earlier affected main commit identified exec_plan as the overflowing field: a valid JSON plan of 88,094 bytes caused the real logging batch to fail, although the user query succeeded. A no-table literal query reproduces the problem; a BF16 index or 10M fixture is not necessary.
This issue reports a statement-log ingestion failure, not a vector-query correctness bug or a proven cause of slow queries. The original cloud payloads were abbreviated in CN logs, so their exact overflowing columns cannot be independently recovered from those artifacts. The local payload provides direct field-level evidence for this failure mechanism.
Environment
- Branch:
main - Deployment: TKE distributed MatrixOne, 3 CN + 1 TN
- Dataset: Wiki, 10,000,000 rows, 768-dimensional F32 source vectors
- Index: IVFFLAT with BF16 quantization,
lists=3162 - Diagnostic settings:
probe_limit=5,ivf_preload_entries=0, K=10, one active query at a time
| Run | MatrixOne commit | Test-script commit |
|---|---|---|
| 37913063613, attempt 1 | 908166384d32e378a72cc3b5ef9e7075603c4e81 |
2032c464d62f02c454f1f50c5152dbb2bf8c3ec9 |
| 37876203973, attempt 3 | 23d8f61252f3017dff218b530817a240206fd762 |
676bda26465440036ac83766cb8292a259af21c5 |
Minimal local reproduction and boundary controls
Tested on Linux/arm64, one isolated CN/TN/LOG instance, MatrixOne main@23d8f61252f3017dff218b530817a240206fd762, 2 CPU / 2 GiB. Image: matrixorigin/matrixone:issue-29145-main-23d8f61252, image ID sha256:607662d9b54ef568d568e52c1a739d587794c994dc97a570b178e3d07506d066. This is a reproduction on an affected historical main commit, not an assertion that the latest main was retested.
Statement tracing and SQL export were enabled, statement aggregation disabled, trace-export-interval=2, long-query-time=0.000001. Each query deliberately sleeps 1.2 seconds to ensure a non-empty execution plan is recorded. No user data table is required.
import time
import pymysql
c = pymysql.connect(host="127.0.0.1", port=16709, user="dump",
password="111", charset="utf8mb4", autocommit=True)
with c.cursor() as q:
q.execute("CREATE DATABASE IF NOT EXISTS issue29809_probe")
q.execute("USE issue29809_probe")
# Send a literal through the SQL protocol, not SQL REPEAT(), which may
# produce a different plan. Run separately so the controls are not batched.
for name, size in [("below", 28000), ("above", 29000),
("repeat", 40000), ("recovery", 100)]:
marker = f"SELECT /* issue29809_{name} */"
q.execute(marker + " SLEEP(1.2), %s AS value", ("a" * size,))
assert q.fetchone()[1] == "a" * size
time.sleep(20)
q.execute("SELECT statement_id, LENGTH(statement), LENGTH(exec_plan) "
"FROM system.statement_info WHERE `database`=%s "
"AND statement LIKE %s",
("issue29809_probe", marker + "%"))
print(name, q.fetchall())
c.close()The complete plan size varies with serialized execution statistics. The relevant limit is the actual plan size, not an invariant SQL-literal character count.
| Test | Actual exec_plan bytes |
Result |
|---|---|---|
| 28,000 ASCII characters, separate batch | 64,092 | User result correct; statement record persisted |
| 29,000 ASCII characters, separate batch | 66,093 | User result correct; internal logger TEXT overflow; no matching record after 20 seconds |
| 40,000 ASCII characters, initial mixed batch | 88,094 | User result correct; internal logger TEXT overflow; raw fallback CSV identifies exec_plan |
| 40,000 ASCII characters, repeated separately | 88,089 | Same overflow reproduced; user result correct |
| 100 ASCII characters after the failures | 8,281 | User result correct; statement record persisted after 20 seconds |
For the 88,094-byte record, stored statement is only 1,027 bytes and valid UTF-8. The execution plan is valid JSON. Its size exactly matches the Src length 88094 error at 2026-10-10 03:05:51 UTC. This rules out oversized stored SQL text as the cause of that local batch failure.
Original TKE reproduction
These are the original workload steps. The local reproducer above avoids loading 10M rows.
-
Prepare the Wiki 10M BF16 fixture using the pinned test-script revision above. The existing TKE workflow selector is
ivf_bf16_quantization_10m,wiki_threshold_diagnostic. -
Run the pinned diagnostic script against that fixture:
python3 -u script/feature_25026_threshold_diagnostic.py \ --host <proxy-host> --output evidence.json
-
The script selects source IDs 1, 2 and 3 and executes
EXPLAINfollowed byEXPLAIN ANALYZEfor ordinaryfile_idPRE filtering and distance-threshold PRE/POST filtering. It uses the same source vector andfile_idacross each sample's variants, with the thresholdl2_distance(...) <= 2.5. -
Inspect CN logs for
sys:mo_loggerfailures while writingsystem.statement_info. Exact SQL, parameters and plans are retained inwiki_threshold_diagnostic/evidence.jsonin the artifacts below.
The older script in run 37876203973 stopped after the first query timeout; only the newer run attempted all nine executions.
Actual behavior
Latest run, 2026-10-09 11:10:55 UTC (19:10:55 Asia/Shanghai):
Can't cast column from TEXT type to TEXT type because of one or more values in that column.
Src length 102392 is larger than Dest length 65535
The associated frontend log records account sys:mo_logger and a failed internal statement:
LOAD DATA INLINE FORMAT='csv', DATA='...' INTO TABLE system.statement_info FIELDS TERMINATED BY ','
status: fail
The earlier run recorded the same failure at 2026-10-09 09:10:09 UTC (17:10:09 Asia/Shanghai):
Src length 104250 is larger than Dest length 65535
These are internal logging writes, not user attempts to insert oversized values into a TEXT column. Eventual persistence of the original cloud records remains unverified because those environments were cleaned up.
Local batch impact and multibyte observation
The initial local failed CSV batch contains four tested SELECT records: a short control (plan 8,271 bytes), 20,000 ASCII characters (48,098 bytes), 40,000 ASCII characters (88,094 bytes), and 10,000 Chinese characters (68,091 bytes). All four user queries returned the exact expected values. None of these four statement IDs was queryable in system.statement_info at the initial 20-second check; the raw records were retained in the ETL fallback CSV. Thus this is not proof of permanent data loss, but the oversized record also delayed normal records sharing its batch.
Automatic ETL retry was observed, not merely assumed: at 03:10:11–03:10:41 UTC, cn-service.ETLMerge retried all three local failed files, reproduced the same 88,089 / 88,094 / 66,093 overflow errors and reported total: 3, success: 0. At 03:11:16 UTC, the initial four statement IDs still each returned count 0, approximately 5 minutes 25 seconds after the first ingestion failure. The CSV files remained available. A later independent short-query batch did persist, so this is batch-level unavailability with failed retry, not complete shutdown of statement logging. No permanent-loss claim is made beyond this observation window.
Initial batch statement IDs, in the order listed above:
01a123c6-16a0-774b-83a0-eba1212e88b6
01a123c6-1b60-7c29-b115-afec6d0e2e62
01a123c6-2031-7434-a774-44608048d68d
01a123c6-24fe-7c80-9d50-27a5718f6e46
Raw initial fallback file: sys/logs/2026/10/10/statement_info/1791601551_7c4dccb4-4d3c-41f8-b482-5251dc7a41bf_ALL_909784512.csv; SHA-256: 7b79f5770089168ca1e04c70b5477931a259feee362e895477b965b914d9b840. The local reproduction scripts, raw CSV files, container log and structured field/persistence checks are archived; the minimal script above is included inline so no access to the local archive is required to reproduce.
Additionally, the Chinese query's fallback statement field is 1,027 bytes and invalid UTF-8: its ending includes the incomplete character bytes e4 b8 followed by 2e 2e 2e (...). Its exec_plan remains valid UTF-8/JSON. This is a directly observed multibyte truncation defect; it is not needed to reproduce the ASCII-only overflow, and its independent ingestion impact has not yet been isolated.
Expected behavior
The statement-log pipeline should handle oversized fields consistently with its storage schema—for example, by using an appropriate field capacity or a documented safe truncation policy—rather than failing its own batch ingestion.
For the verified local reproduction, exec_plan must be handled consistently with its destination capacity. Any truncation must preserve valid UTF-8 and an appropriate execution-plan representation. Normal records should not remain unavailable because another record in their batch is oversized.
Source evidence at the reproduced revision
schema.godeclaresexec_planas a TEXT column.report_statement.goobtains the serialized plan and assigns it to the row;ExecPlan2Jsonreturns the marshaled plan without a destination-length check.content.gofalls back from SQL export to CSV for the batch when SQL export fails, matching the observed local file.
Stability and controls
- The same ingestion error was observed in two independent cloud runs on two
maincommits. Local ASCII-only boundary tests reproduce the error without any vector data. - In the latest run, all nine static plans were collected; seven
EXPLAIN ANALYZEexecutions completed and two were cancelled by the diagnostic's 60-second deadline. - Both cancellations were acknowledged and the original connection recovered before subsequent queries. The returned
1105 context cancelederrors are expected consequences of those cancellations, not evidence that this logging failure caused the query failures. - The three-row BF16 control completed all nine local diagnostic executions without overflow. No user-result corruption or causal link to slow/cancelled queries has been established.
Evidence
| Run | Raw job / artifact | Relevant file inside the artifact |
|---|---|---|
| 37913063613, attempt 1 | Job · Artifact | wiki_threshold_diagnostic/nightly-regression-dis-tp-cn-tk4dm.log, lines 277–279 |
| 37876203973, attempt 3 | Job · Artifact | wiki_threshold_diagnostic/nightly-regression-dis-tp-cn-m6qmf.log, lines 127–129 |
Both artifacts also contain query output and structured execution evidence. The error first appears in function/func_cast.go and is then reported by the frontend for the internal logging write; this identifies the failure boundary, not the upstream field-sizing root cause.
Regression coverage
After fixing the defect, exercise the real statement-reporting pipeline and verify:
- Boundary lengths and oversized SQL/plan fields are stored or safely truncated according to the intended contract.
- Multibyte text remains valid after any truncation.
- Normal records in the same batch are still persisted, and the pipeline remains usable after an oversized record.
- User query execution and results are unaffected.
A direct oversized INSERT into a user TEXT column is not an equivalent regression test.
Related
- [Bug]: LIST-to-vector Parquet LOAD forces wide 100M rows into row mode and times out #29229 mentions similar
system.statement_infoTEXT-length errors, but tracks Parquet LOAD performance rather than this logging defect. - [Bug]: IVF Wiki 10M has sustained object-column read/decompression amplification under bounded cache #28627 tracks the separate vector read/decompression performance investigation. No causal link from this ingestion error to the slow queries is claimed.
- Searches on 2026-10-10 for
statement_info+65535,statement_info+TEXT, andSrc length+65535did not find a dedicated duplicate issue.
Activity
XuPeng-SH commentedon Oct 10, 2026
fixed by #29812
slyunnn commentedon Oct 10, 2026
Verification Environment
origin/main:62827a1c8bfb1c846c0f3528e71503baacb3b3bc,fix: bound statement_info diagnostics to TEXT capacity (#29812).1.27.1on Linux/ARM64; newly started runtime reports this commit. Binary SHA-256:3af12f7e2fb608aaaea4abf443ecad2f4e286d7e1c9db0871db2f736d835c69e.2 CN / 1 TN / 1 Log service / Proxytopology, local-disk storage. CN statement tracing and SQL export enabled, statement aggregation disabled, export interval2seconds, long-query threshold0.000001seconds.127.0.0.1:6721(container6009), CN1127.0.0.1:16721(container16001), CN2127.0.0.1:16722(container16002). Alternate host ports avoid existing services; this is not a test of the pre-existing6001/16001/16002deployment.COM_QUERY,utf8mb4. Literal payloads are sent through SQL, withSLEEP(1.2)to capture non-empty plans. The oracle checks realsystem.statement_infopersistence, not direct oversized insertion into a user table.What Was Covered
18/18user queries (6per endpoint) returned exact expected values, and every corresponding statement record persisted within the bounded45-second polling window.64086bytes on all endpoints.66087–66093bytes and larger plans of88088–88091bytes were replaced with valid141-byte JSON summaries, withtruncated=true,original_bytes>65535, andlimit_bytes=65535.6Chinese/emoji statement records contained invalid UTF-8. Their storedstatementlength was1027bytes; the retained prefix ended with incompletee4orf0before2e2e2e(...).UnicodeDecodeError. This check used separate connections so the expected decoding failure did not contaminate later test results.11 KB, below the capacity limit.10M, or benchmark vector-query performance. The earlier same-commit verification separately reports historical ETL recovery; it is not presented as newly executed here.Findings
Related merged fix: #29812 — fix: bound statement_info diagnostics to TEXT capacity, commit
62827a1c8bfb1c846c0f3528e71503baacb3b3bc.The original live execution-plan overflow is fixed in this regression. The remaining SQL-text integrity defect is confirmed through Proxy and both CNs, consistent with the earlier comment.
commonutil.Abbreviatestill slices the input by bytes at the frontend abbreviation boundary.CapStatementInfoTextreturns inputs within65535bytes unchanged, so it does not repair an already-invalid1027-byte statement. Correct user-query results and successful log insertion therefore do not imply readable statement text.The first diagnostic attempt continued on a connection interrupted by a decode error and subsequently encountered a packet-sequence error. The final complete run isolated decoding checks onto disposable connections and completed normally; the UTF-8 defect remained directly reproducible. Script completion does not mean the failed UTF-8 assertions passed.
Fix UTF-8 statement diagnostics and bound prepared logging work (#29826)
dengn commentedon Oct 12, 2026
Additional observation during native BI compatibility testing on the same affected commit
23d8f61252f3017dff218b530817a240206fd762(standalone Linux x86_64, 2026-10-12 UTC): thesys:mo_loggerpipeline repeatedly reports failedLOAD DATA INLINE ... INTO TABLE system.statement_infobatches with the existing TEXT-overflow signature.One recorded example:
There were 224 matching log records in the inspected interval; these are failed batch log entries, not 224 identified unique user statements. The inline CSV is abbreviated in the CN log, so this observation does not independently identify the overflowing column or quantify how many trace rows are missing.
The user-facing analytics can still succeed: 534 SQL controls and 534 full JDBC results matched independent references during this iteration. This adds evidence that the logging failure also appears with ordinary BI/semantic-model workloads; no new issue is opened, and no current-HEAD regression or user-query computation failure is asserted.
slyunnn commentedon Oct 13, 2026
Regression and extended verification for #29809 (2026-10-13)
Verification Environment
origin/main:e5111936b9f5845d5d76c7b8f3a6f56b2361e4f4,fix(parser): accept reserved words in qualified identifiers (#30027).mo-servicebinary was rebuilt from that exact commit and its reported commit ID matched it.2 CN / 1 TN / 1 Log service / Proxytopology was used. Proxy127.0.0.1:6741(container6009), CN1127.0.0.1:16741(container16001), and CN2127.0.0.1:16742were each connected and exercised.COM_QUERY,utf8mb4). The three endpoint sessions were isolated and executed in parallel; each session remained serial while waiting for its own asynchronous statement export.What Was Covered
28,000,29,000, and40,000ASCII bytes) returned the expected user values and persisted one successfulsystem.statement_inforow at every endpoint.exec_planwas valid JSON and within the65535-byteTEXTcapacity. Current main emits a bounded diagnostic summary of638–643bytes for these shapes instead of the historical full66–88 KBplan that failed ingestion.6/6records).18/18selected statement records were created by this run rather than inherited history.10MBF16 workload and pre-existing ETL fallback files were not replayed. They are not required to reproduce this statement-diagnostics sizing defect.COM_STMT_PREPARE/COM_STMT_EXECUTE) was not repeated in this integration run; its focused coverage is part of merged#29826.Findings
The original ingestion failure is fixed. The related fixes are
62827a1c8bfb1c846c0f3528e71503baacb3b3bc/ #29812,fix: bound statement_info diagnostics to TEXT capacity, and652c643666428f1c434e03369834f2a9bead7c27/ #29826,Fix UTF-8 statement diagnostics and bound prepared logging work.The initial re-validation configuration incorrectly gave each service a separate local-disk
/mo-data, which madeSHAREDunavailable across CNs and caused20405 file ... is not found. The topology was discarded and recreated with the required shared data volume before final results were collected; this was a test-environment error, not a product result.MOTR / BVT Coverage
No MOTR change was added. The merged fixes already include focused ownership tests for capacity boundaries, UTF-8 boundaries, row serialization, ETL upload, and prepared diagnostics; this run supplied the missing current-main, multi-CN/Proxy integration evidence through the actual statement-reporting pipeline.
Large-data regression is not needed: the defect is determined by diagnostic-field byte capacity and UTF-8 boundaries, not row count, vector index size, spill, concurrency, or resource scale. The original
10Mworkload is a workload source, not a necessary execution boundary for this logging failure.Final Conclusion
Fixed. On latest
main, the original wide diagnostic scenario, multibyte boundary cases, and recovery behavior all completed successfully through Proxy, CN1, and CN2. No MatrixOne service source or MOTR files were modified in this verification.