Repository navigation
fix(logservice): harden reads, proposals, snapshots, truncation, and HAKeeper restart - #32149
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? |
|
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: 790bca99211ad431e9ea62429cc4c955956b9ef2
Assessment: approve
The fixes reuse existing retry, snapshot/truncation and restart owners. Per-replica uncertainty tracking is justified by late export completion, while unaffected replicas avoid disk scans. No actionable correctness or design findings remain.
Model: gpt-6.1-sol / max
Session: 01a1a004-9884-72c0-ad39-f096c4209c4a · slot 1 · generation 0
Validation:
-
Reviewed all 18 changed files, affected consumers, and linked issue bodies/comments; all three discussion keys are covered.
-
Local isolation preflight and source/provenance/whitespace checks passed. Receipts and retained logs are reconciled in validation-ledger.json.
-
Frozen-head CI passed shared build, UT, SCA, coverage and PROXY/PESSIMISTIC BVT checks. Reused matching author-reported normal/race regressions and recovery tests.
Limitations:
-
No fresh local Go or cluster tests executed; author raw logs were not supplied.
-
Read/WAL three-voter network-chaos scenarios were not rerun. The seven-second child deadline does not bound blocked sends or empty-pool acquisition; healthy longer requests may retry.
-
Uncertain replicas continue scanning, with possible transient quota excess. The separate Dragonboat proposal-transport fix remains outside this PR.
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #32148
Fixes #32144
Fixes #32159
Fixes #32151
Fixes #32161
Fixes #32235
Related to #32133
What this PR does / why we need it:
Readattempt a seven-second child deadline. If an established data connection stops answering after the request is sent, reset that connection and retry the same LSN while the caller context remains live. Read can be repeated safely; writes retain their existing unknown-result behavior. Connection failures from MORPC also take this retry path, so this works alongside fix(logservice): bound stalled RPCs and stale HAKeeper startup #32147's shared backend read window.GetTruncatedLsnattempt to seven seconds. A stalled read resets its LogService connection and retries while the caller is live; the WAL driver now keeps one overall replay deadline and cancels retry backoff promptly. This letsReplayForWritetry another available replica when its first truncate-watermark read stalls.AppendandTruncatewrite semantics are unchanged.Truncatetarget at or beyond the Raft index of the truncate command when the state machine applies it. The persisted watermark cannot advance past entries already committed, so later acknowledged appends remain readable. The API keeps theErrInvalidTruncateLsnerror class.Validation
make -j4 cgo: passed on each original branch; native inputs are unchanged in the combined branch.pkg/logservicepluspkg/common/moerrpackages: passed on the combined branch.pkg/logservicerace package for the original Read/snapshot changes: passed on the original fix(logservice): harden reads, proposals, snapshots, truncation, and HAKeeper restart #32149 head. The combined branch preserves those code paths.go vetfor LogService and its WAL driver passed on the original fix(logservice): harden reads, proposals, snapshots, truncation, and HAKeeper restart #32149 head. The combined branch includes a separatego vetresult for LogService andmoerr.pkg/logservicenormal and race packages, focused race repetitions, andgo vet ./pkg/logservicepassed on that head.ReplayForWriteretried a transient watermark error, and cancellation stopped the driver after one attempt. Completepkg/logserviceand WAL-driver packages passed in normal and race modes; focused race repetitions passed (client 3, replay 20, cancellation 20);go vetpassed for both packages.790bca9921, upstream/main through65b721e1b9supplies fix(logservice): bound stalled RPCs and stale HAKeeper startup #32147. The focused prior CI failures passed locally; the LIKE index case passed three consecutive runs after its deterministic test correction. Completepkg/logserviceand WAL-driver package tests, build, and vet passed against the MatrixOrigin Dragonboat dependency. The new MatrixOne CI is pending.Relationship and limits
The merged upstream/main includes #32147, which bounds the underlying data connection's read window for all operations. This PR adds
ReadandGetTruncatedLsnretry semantics without duplicating that patch. The child deadline is not a hard bound on every possible blocked send path inside MORPC; the reproduced failures stall after a small request is sent. A healthyReadorGetTruncatedLsnlasting more than seven seconds can be retried. Reconnect still uses existing randomized endpoint selection, so a single failed attempt does not guarantee a healthy endpoint on the next pick. The regressions use a single server behind a response-dropping proxy; the three-voter network-namespace chaos scenarios forReadand WAL replay have not been rerun on this branch. The pending-proposal transport fix for #32133 is in matrixorigin/dragonboat#20, which is still open and is not included in this PR. This PR uses the existing MatrixOrigin Dragonboat version. The three-voter network-namespace failure scenario has not been rerun, so #32133 is not claimed fully resolved. The WAL driver'sclientPool.Get()remains context-unaware when the pool is empty, outside #32235's reproduced case with available pooled clients. Crash-marker cleanup remains a startup path; late valid exports are reconciled while the process runs on later truncation ticks. An affected replica continues to scan after an ambiguous request because the completion can arrive after any scan; disk quota can be exceeded transiently before the next tick.When no peer can answer during HAKeeper cold restart, the choice among locally persisted replicas relies on monotonic replica IDs. The new three-voter regression verifies that this restores quorum with the issue's duplicate-metadata shape. The installed local
golangci-lintwas built with Go 1.26 and cannot lint this Go 1.27.1 repository; CI will run the configured lint check.