Repository navigation
fix(logservice): fail non-progressing Tan EOF reads - #30288
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 74034855150160b7e83e284de59fdf312d5ff684
Assessment: request_changes
Reviewed the complete three-file delta and exact dependency changes. The progress guard belongs in Tan’s indexed reader, preserves normal EOF and size-limit behavior, and reuses existing cleanup/error handling. It adds constant per-scan work without new shared state or I/O. Regression checks passed, but the declared production-dependency prerequisite remains unresolved.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
- P2
go.mod:304: Merging this non-draft head retains github.com/LeftHandCold/dragonboat/v4 as the production dependency.
Impact: This ships the explicitly temporary review/CI pin before the declared official-dependency and final-validation requirements are fulfilled. Replace it with an immutable MatrixOrigin revision containing the fix, update checksums, compare its contents with the tested revision, and validate the focused regression plus LogService package against that final pin.
Evidence: The frozen PR description explicitly identifies ca11de296963 as temporary and requires the official replacement before readiness. Current go.mod still selects that fork; evidence.json marks the PR non-draft and supplies no final-pin validation. Existing CI and the local checks cover the temporary dependency only.
Validation:
-
Verified clean frozen source and checksum-verified both dependency archives. Their only differences are internal/tan/db.go and the new read_progress_test.go.
-
Isolation preflight passed. Thirteen selected Tan tests passed in 1.341s, covering non-progress reads, overwrite, rotation, restart, rebuild, torn tails and size limits. Receipt: checks/1792119704395320037-3.json; log: tan-regression.log.
-
The diagnostic old-reader control failed as expected in all three non-progress cases with the bounded repeated-open error. Receipt: checks/1792119786932844266-4.json; log: tan-old-reader-copy-control.log.
-
Reconciled commands, source fingerprints, exit receipts, logs and control-input hashes in validation-audit.json. Audit receipt: checks/1792119877254617043-4.json. Artifacts are retained under the assigned attempt-1 directory.
-
Frozen-head CI reports successful Ubuntu UT, Linux/arm64 SCA, builds and proxy/pessimistic multi-CN BVT.
Limitations:
-
No local full LogService or race rerun; CI raw test logs and traceable author-run artifacts were not supplied.
-
The initial old-reader overlay attempt was rejected before execution; the diagnostic-copy control subsequently executed successfully.
-
Original incident archives were not replayed. Missing-record origin and data recovery remain outside this fix.
-
Performance costs were assessed from code and callers; no benchmark was run.
|
已修复本轮 review 的依赖交付阻断,更新提交:
本次只解决“不再无限读取同一 EOF 位置”,仍不宣称修复或恢复已经缺失的日志记录。新 Head 的 GitHub CI 由推送触发,本地通过不替代该轮 CI 结果。 |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 62ac3eb2302f628e46001550260cdc9ce565c708
Assessment: approve
Reviewed the complete MatrixOne and dependency deltas. The official dependency prerequisite is resolved. Tan owns the progress invariant, and the guard preserves legitimate EOF and size-limit behavior while reusing existing cleanup and fail-stop error handling. It adds constant per-scan bookkeeping without new shared state or healthy-path I/O. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Verified official module resolution and checksums. The complete base-to-head dependency comparison changes only the indexed-reader implementation and its regression tests.
-
Full LogService suite passed: 377 tests, no skips, 64.439 seconds, with vet enabled. The configured-factory EOF regression also passed 100 race repetitions.
-
Full Tan package passed under race: 87 tests, no skips. Coverage includes persisted/reopened EOF, valid-prefix and state-only cases, size limits, overwrite, rotation, restart, compaction and torn-tail handling.
-
The new MatrixOne regression with the original dependency pin failed as expected at the bounded repeated-open guard, confirming it detects the original defect.
-
Isolation preflight, fresh native build, provenance checks, formatting and diff checks passed. Source remained unchanged. Receipts, log hashes and terminal test events are reconciled in /home/xupeng/.local/state/mo-bot/jobs/0e92db1486af76ce639bf7d1/attempt-1/validation-audit.json; detailed review notes are retained alongside it.
Limitations:
-
Original incident archives were not replayed. Missing-record cause and data recovery remain outside this fix; the storage error follows the existing Raft fail-stop path.
-
The linked issue body and raw author/CI execution artifacts were absent from frozen evidence. Local checks independently validated the final pin.
-
Performance effects were assessed from implementation and callers; no benchmark was run.
|
Queued — the merge queue status continues in this comment ↓. |
Merge Queue Status
This pull request spent 53 minutes 14 seconds in the queue, including 52 minutes 36 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #30219 (the Tan EOF non-progress loop, not repair of missing committed log records).
Official dependency — merge prerequisite resolved
The dependency fix, matrixorigin/dragonboat#19, merged on 2026-10-16 at official commit
0b20c95f67f8e5eb119d1913b18fa8c9b09612b9.This PR now selects
github.com/matrixorigin/dragonboat/v4 v4.0.0-20261016015224-0b20c95f67f8, with its official module checksums. The temporary personal-fork replacement and checksums have been removed.The official commit and the previously tested fork commit
ca11de296963e7f10269654476aab1b88d81cb7ehave the same Git tree,5dd8f8b2110c3ce2fdaffc5d0a3dfc7c3c848271. A recursive comparison of the downloaded Go module directories also found no differences. The focused regression, race repetitions and complete LogService package were rerun against the final official pin, as requested in review.What this PR does / why we need it:
Tan
readLogreturns nil on EOF. When a persisted entry index points at EOF, no entry callback advancespassed, butgetEntriesreopens the same position indefinitely. This blocks the Raft worker inside storage I/O iteration, so it cannot observe its stop channel. The issue's repeated open/seek/entry-loader stacks match this path.The dependency fix detects a scan that consumes no index entry, returns a contextual storage error and preserves the normal size-limit early return. It does not alter normal EOF semantics used by rotation/rebuild, rewrite files, skip missing entries, change the persistent format or introduce a background task. The error follows the existing fail-stop Raft worker path; this is not automatic data recovery.
9ef6a64061dadddfdcb9b80082fe6ae1c31421b3introduced this loop in Dragonboat on 2022-11-15. That identifies the origin of the loop, not why the reporter's log bytes went missing. The original MatrixOne dependency treeabc3d2fce5a6is identical to the upstream fix's base18a1f46a2ea64eb42a2b330ef98d662ca68a1365, so this pin adds no unrelated production changes.The new MatrixOne test uses the actual configured LogDB factory from
getNodeHostConfig. It writes and reads a real Tan entry on an isolated in-memory FS, injects EOF at the indexed position, requires an error after a single open, then verifies the original entry remains readable. A bounded fake-FS open count makes the old dependency fail deterministically instead of hanging CI. Cleanup checks file closure.Local validation on host 50
Final-pin validation used MatrixOne head
74034855150160b7e83e284de59fdf312d5ff684plus the official dependency/checksum substitution; merge basec46b893f6160902e74b3581fc968666cb9d07003. This review update changes onlygo.modandgo.sum; the regression test is unchanged.Linux amd64, Go 1.27.1,
GOMAXPROCS=4, package parallelism-p=2. Tests used.agents/skills/mo-dev/scripts/mo-cgo-testwith repository native-artifact provenance checks. No module-cache edits or copied native libraries were used.go list -m -json github.com/lni/dragonboat/v4TestTanIndexedEOFReturnsErrorplusTestStoreCanBeCreatedAndClosed,-count=1 -timeout=120s./pkg/logservice,-count=1 -timeout=600sTestTanIndexedEOFReturnsError,-race -count=100 -timeout=120sgit diff --checkEarlier counterexample evidence: the new test with the original
abc3d2fce5a6pin failed as intended when a repeated open reached the injected-error guard. The dependency PR separately passed Tan/LogReader/Raft package tests, Tan race tests, vet and a full Dragonboat build. Its persisted-index reopen tests cover EOF, a valid prefix before EOF and a state-only indexed position, plus healthy prefix/size-limit behavior; existing tests cover rotation, overwrite, restart, compaction and torn-tail recovery. These are prior results, not additional executions claimed for this dependency-only update.Self-review / scope
No SQL BVT: the changed contract is the persisted Raft-log reader below SQL, tested at Tan, LogReader and MatrixOne's configured LogDB boundaries. The original multi-GB issue archives were not replayed in this validation; the exact bad-index/EOF condition was injected into small fixtures, including a persisted/reopened fixture in the dependency tests. We do not claim the missing source records were recovered, the missing-byte origin is established, or 4.2 has already received this change.