Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Related, but not the same remaining defect:
- [Bug]: COS fileservice PUT
connection resetduring Load #24916 / fix: retry QCloud PUT with seekable reader #24917 added replayable COS PUT retries for connection resets. The replay mechanism exists in this report; its classifier rejects ordinary HTTP EOF. - [Bug]: LOAD DATA fails on transient COS multipart-init idle-connection close without safe recovery #28028 addresses multipart-init POST, whose server-side state makes blind replay unsafe. The observed request here is an ordinary object PUT, not
POST ...?uploads. - [Bug]: INSERT SELECT hangs and leaks transaction after COS upload idle-connection failure #27876 involved a storage error followed by lost terminal delivery and a hanging transaction. This occurrence returned an SQL error promptly; that cleanup failure is not alleged here.
- [Bug]: Nightly regression 中 objectio 层频繁 COS 超时 / 502 导致多个 benchmark 测试失败 #24998 recorded earlier timeout/502 and connection-management symptoms, not this deterministic plain-EOF classification gap.
Exact-symbol, plain-EOF, and COS/PUT/retry searches of open and closed Issues found no accurate existing tracker for this gap.
Branch Name
main
Commit ID
- Observed and independently reproduced:
72d4a49db7d750520e1a1654cb6091fc7169882b. - Source rechecked against fetched main
0ccc989731f9c2b40d31554a44ca505c656c0e62:qcloud_sdk.go,error.go,retry.go, andgo.modare unchanged from the reproduced revision. The newer revision was not independently started as a SQL service.
Other Environment Information
- Main Weekly run: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/37959361150
- MOTR job: https://github.com/matrixorigin/mo-nightly-regression/actions/runs/37959361150/job/114031508294
- Tested MO image digest:
sha256:af11feb8e4eece7ad7a65ed1709e411771628306410dd7726176e63d09f46f60. - Namespace:
mo-main-family-37959361150-1. - Affected pod:
nightly-regression-dis-tp-cn-hmlqk. - Topology: one TP CN, two AP CNs; CN memory 55 GiB / FileService memory cache 16 GiB; TN memory 32 GiB.
- COS SDK:
github.com/tencentyun/cos-go-sdk-v5 v0.7.55. - Retained resource capture: all nine pods Ready, zero restarts; no OOM evidence explaining this statement failure.
- Independent validation: isolated source worktree on macOS arm64, Go 1.27.1, real loopback HTTP server plus a deterministic RoundTripper control. No shared cluster or production resources were modified.
Actual Behavior
At 2026-10-09 21:27:32.053 UTC / 2026-10-10 05:27:32.053 CST, MOTR case issue_26232_view_default_ctas failed while writing an object to COS:
[DoneWithErr] Write Sync error
can't get reader content length, unkown reader type;
Put "https://<cos-endpoint>/<run-prefix>/data/<object>": EOF
The exact failing SQL was:
insert into ctas_v(id) values (2);The preceding CTAS creation had succeeded. This is therefore not proof that CTAS construction, its default expression, or its original Issue regressed.
The object write error propagates through objectio/writer.go, the internal SQL executor, and frontend SQL error handling. One transient transport EOF fails this INSERT even though QCloudSDK.Write already owns a replayable buffered/seekable source.
Expected Behavior
For an ordinary object PUT whose body can be replayed from the original offset, recognize a transport EOF as a recoverable attempt failure and apply a bounded, context-aware retry with the same key and complete body. Preserve prompt failure on cancellation, exhausted recovery, permanent authorization errors, and invalid source data.
Do not implement this by blindly retrying state-creating multipart-init POST, retrying a consumed non-seekable body, matching every error string containing EOF, or hiding arbitrary statement failures behind whole-SQL retries.
Steps to Reproduce
The failure does not require a whole Weekly run or a COS credential:
- At the reproduced commit, construct a
QCloudSDKwith a realcos.Clientpointing to a loopback HTTP test server. Disable SDK retries asNewQCloudSDKdoes (RetryOpt.Count=0). Disable CRC in this minimal server fixture, which does not implement COS CRC headers. - Provide a non-empty buffered payload and a matching size hint to the real
QCloudSDK.Writemethod. - On the server's first PUT, consume the whole body and close the TCP connection without sending any HTTP response. On a later PUT, return HTTP 200.
- Observe that
Writereturns*cos.RetryErrorcontainingPut ...: EOFafter one request. The healthy second attempt is never made. - As a counterfactual, allow exactly one replay of this same write with a fresh reader after the EOF. It succeeds after two requests; both requests contain the identical complete payload.
Independent controls using the same production Write entry point:
| First-attempt condition | Attempts | Outcome |
|---|---|---|
Transport io.EOF |
1 | Write fails |
Transport io.ErrUnexpectedEOF |
2 | Write succeeds; both bodies are complete and identical |
| Real HTTP peer closes after consuming PUT body | 1 | Write fails with the same error shape as the Weekly log |
| Same real peer closure, one bounded replay with a fresh body | 2 | Write succeeds; identical object bytes |
All four conditions were repeated five times with -count=5; the diagnostic assertions passed every time. Passing diagnostics mean that the production failure was reproduced as expected, not that a production fix has been implemented. This validation exercises the actual MO COS write method and the actual COS SDK, not only a copied error classifier.
Additional information
Confirmed MO-side mechanism
NewQCloudSDKdisables built-in SDK retries. MatrixOne is responsible for recovery.QCloudSDK.Writebuffers small objects and constructs a freshbytes.Readerper retry; for a seekable source it restores the original offset before each PUT. Thus the known replay capability is already owned by this outer method.putObjectwraps the source incountingReaderand invokes COSObject.Putonce.- The SDK returns a
*cos.RetryErrorcontaining a*url.Errorwrapping ordinaryio.EOFwhen the peer closes without response headers. IsRetryableErrorinspects the inner SDK errors but recognizesio.ErrUnexpectedEOF, notio.EOF. The ordinary EOF is not a timeout, reset, or one of the recognized string cases. The outer write loop stops after its first attempt.
Source owners at the exact reproduced revision:
- Replay ownership in QCloudSDK.Write
- SDK retries disabled
- Ordinary object PUT
- RetryError traversal and missing EOF class
The SDK's can't get reader content length, unkown reader type prefix is not, by itself, proof of a missing MO size hint. countingReader is not one of the SDK's recognized length-bearing reader types; the SDK can retain that diagnostic while still sending a request with the supplied ContentLength. The real-HTTP fixture reproduces the same prefix despite a valid explicit size hint and receipt of the whole payload. The terminal transport error is EOF.
Regression classification
This is a newly tracked availability defect, not a demonstrated recent regression. The classifier already omitted ordinary EOF when #24917 added replayable PUT retry on 2026-06-11. No introducing commit for the Weekly occurrence, and no code change causing the connection closure, has been established.
What remains unknown
- The retained production evidence cannot identify whether COS, a load balancer, NAT, or another intermediary closed the connection.
- The test reproduces the MO recovery gap, not the original infrastructure trigger or production request count.
- No permanent data loss, statement atomicity violation, whole-CN crash, or transaction leak is asserted.
- This report does not establish a tested affected-version range for 4.2.
Narrow acceptance criteria for a future fix
- Exercise the real COS write path for both buffered and seekable sources; preserve original seek offsets and identical complete bytes after replay.
- Cover ordinary wrapped HTTP EOF separately from
io.ErrUnexpectedEOF. - Preserve bounded backoff, caller cancellation/deadline, and fail-fast permanent errors.
- Do not expand multipart-init recovery or other non-idempotent operations without their own proof.
- Distinguish HTTP response EOF from a permanently truncated input reader. Do not broaden shared retry policy without auditing the affected callers.
- Retain statement rollback and connection-reuse checks when validating through SQL.
Activity
LeftHandCold commentedon Oct 10, 2026
Root cause confirmed; narrow main fix and validation
Fix PR: #29820
Source baseline:
main@62827a1c8bfb1c846c0f3528e71503baacb3b3bc.Tested/reviewed fix:
4fdb76b82bc821ac0ad340a46f29b4946fc4d61f.Upstream was rechecked at
888e1ea4469b6c2bf7a23c31f3376654cb8a30ccbeforepublication; its newer commit does not change the COS/retry contract.
Confirmed MO-side cause: the COS SDK returns an opaque
RetryErrorcontaining
url.Error{Op: "Put", Err: io.EOF}. The shared classifier rejectsordinary EOF, so
QCloudSDK.Writestops after the first attempt even thoughit already owns a buffered or seekable, replayable body. This is not an
invalid-content-length diagnosis: the real HTTP listener receives the entire
correctly sized body and produces the same SDK error shape.
Original infrastructure trigger remains unknown. The evidence does not
identify whether COS, a load balancer, NAT or another peer closed the
production connection. This fix addresses the demonstrated MO recovery gap,
not that upstream trigger. No recent introducing PR has been established.
Before/after evidence on shanghai50
No existing services or shared test data were modified. Validation used an
isolated Linux amd64 worktree, the actual COS SDK, and a real HTTP listener.
failure after 1 PUT;
unexpected EOFcontrol recovers after 2 PUTs;closing the real connection after consuming the whole body reproduces the
Weekly error; a single bounded replay succeeds with identical complete bytes.
the server stores the first complete object but loses its response. The write
recovers after exactly 2 identical PUTs, and a subsequent real read of the
stored object returns the expected content.
pkg/fileservicepackage with-race -count=1passed: 147.170s(
GOMAXPROCS=4,-p 4). Changed file hashes match the local reviewed files.regression passed 100 race repetitions; full owning-package race passed.
Risk containment and reviewed boundaries
replay are reused. No new retry layer, global state, lock or algorithm.
this retry condition. Cancellation and exhaustion have explicit controls.
initiation/part/completion protocols remain unchanged. Small/empty multipart
fallbacks already using ordinary
Writebenefit at that same PUT boundary.normal-path allocation, buffering or I/O. Ambiguous PUT recovery may produce
another provider request/version/event, as existing PUT retries already do.
validation, not a full SQL rollback or live-COS Weekly rerun.
The ready-for-review PR targets main, uses the repository template and
references this Issue. At publication, CI preflight passed; build/UT/SCA were
still running or queued, not declared passed.
Subsequent integration update: Mergify automatically merged the latest main,
producing head
8c0d609c492f6bb19c5363dc55a9000ee23ae55f. The FileService code,tests, CGo sources and Go dependencies are unchanged from the validated fix.
Focused COS/multipart/retry controls were rerun on that exact head and passed
(1.021s). The first CI run was cancelled by this synchronization, not by a
test assertion; replacement run https://github.com/matrixorigin/matrixone/actions/runs/38032094089
is running, with no failed checks observed at read-back.
fix(fileservice): retry replayable COS PUT on HTTP EOF (#29820)