Repository navigation
[4.2-dev] fix(tae): complete WAL waiters before append fail-stop - #33209
mergify[bot] merged 13 commits into
Conversation
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: e8099d2e858f62e2d09dd0f6f5da6f23588de589
Assessment: request_changes
The group completion and shutdown changes reuse the existing WAL queues and address the previously reported same-directory fencing, retry, handoff, failure-completion and admission cases. The writer-overlap concern remains open across TN hosts: asynchronous WAL draining can continue after a replacement has started, allowing duplicate sequence numbers and lost replayed data.
Model: gpt-6.1-terra / max
Session: 01a21492-3a62-72c3-9f89-e80a3d268af4 · slot 0 · generation 14
- P1
pkg/vm/engine/tae/logstore/driver/logservicedriver/driver.go:182: WAL shutdown reaches its deadline with accepted checkpoint-file entries still draining, and the TN shard is reassigned to a replica on another host.
Impact: The replacement can replay and commit a new WAL entry while the old drain later writes an entry with the same DSN. A subsequent replay can select the old entry and omit the replacement's entry, potentially losing an acknowledged transaction.
Evidence: CloseAfterDrain leaves the drain running after returning an error. The retained lock in db/lock.go:92 protects only the local directory, while tnservice/store.go:424 removes the replica even when close fails. An embedded LogService probe with distinct replica IDs observed DSNs [1, 2, 2, 2]; subsequent WAL replay returned [old-first, old-second] and omitted the successfully completed replacement GroupUserTxn test entry. Replay's DSN-to-PSN map overwrites duplicate DSNs at replayer.go:830. Establish an authoritative shard-level handoff or fence that prevents the predecessor from appending or reacquiring its lease after replacement, while preserving bounded close and unknown-outcome semantics, and cover the takeover path.
Validation:
-
Private-runtime preflight passed; retained native inputs matched the frozen checkout. Receipts: 1795641718064808430-3 and 1795641723918990908-3.
-
Reused 12 focused exact-head tests from attempt 1, all passing; receipt 1795641216674546595-3 and focused-tests.log.
-
Six selected driver, WAL and DB tests passed under race; receipt 1795642207929862384-3 and focused-race.log.
-
Review-only pre-callback and serialization failure probes passed; receipt 1795642261757627381-3 and serialization-probe.log.
-
The cross-replica replay probe completed and reproduced the omitted entry; receipt 1795641819091663384-3 and cross-tn-replay-probe.log. All seven discussion keys were assessed exactly once.
Limitations:
-
The takeover probe used an embedded LogService, synthetic WAL entries, an injected delayed response and a shortened close timeout. It did not run a live TN failover or a SQL transaction.
-
Full owning-package suites were not rerun locally. The author's reported macOS suite and race results had no retained logs in local_validation.
|
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: 759eb54d7f3b6d239acdbd3f2988a1976c1518e7
Assessment: request_changes
The earlier cross-host WAL overlap concern remains open when standby data sync is enabled. The new lease factory also turns a transient startup failure into a persistent initialization failure. The change reuses the existing queues and lease mechanism, but the lease is not authoritative over all existing consumers. Earlier concerns about same-directory locking, waiter completion, admission, retry, and worker handoff have focused coverage at this head.
Model: gpt-6.1-terra / max
Session: 01a214fd-5519-75c1-ba9a-e15d93ce4077 · slot 1 · generation 16
-
P1
pkg/logservice/client.go:150: Standby data sync connects or reconnects its upstream reader to the TN WAL shard after a replacement writer claims the lease, while a timed-out predecessor still has an append draining.
Impact: The reader's connection sets the lease holder to zero, which disables lease checks. Both writers can then persist the same DSN, and replay can omit the replacement's acknowledged entry.
Evidence: The data-sync client uses NewStandbyClient with ReadOnly=false and TNReplicaID=0; the LogService state machine accepts that lease and skips holder checks for zero. In standby-test.log, the existing takeover test passed without this connection, while the review probe using the same standby-client configuration acknowledged DSN 2 from both writers and replayed [old-first, old-second], omitting replacement. Preserve the writer lease when the upstream reader attaches, while retaining the zero-lease behavior needed by the standby shard. -
P2
pkg/logservice/client.go:163: The first lease update encounters a transient transport error after the read-only connection succeeds.
Impact: sync.Once permanently retains the error for every client in the factory. The TAE client pool repeatedly reconnects but never retries a recoverable claim; after its retry budget is exhausted, pool initialization panics even if LogService has recovered.
Evidence: claim-error-test.log records a one-time pre-send error, a second call returning the cached error, and a fresh factory successfully claiming and appending. clientpool.go retries factory calls and panics when initialization exhausts its budget. Make definitively unsubmitted failures recoverable and hand ambiguous outcomes to a bounded, fenced ownership path; do not blindly retry a claim that may already have committed.
Validation:
-
Private-runtime preflight passed; receipt checks/1795648848385136779-2.json. Retained native inputs matched the checkout; receipt checks/1795649086388184898-2.json.
-
The takeover control and standby-interaction probe completed with exit 0; the probe deliberately asserted the reproduced data-loss behavior. See standby-test.log and receipt checks/1795649108644735782-2.json.
-
The transient-claim probe completed with exit 0 and deliberately asserted the cached-error behavior. See claim-error-test.log and receipt checks/1795648864921744898-2.json.
-
Eight selected WAL, driver, and DB lock tests passed; see focused-tests.log and receipt checks/1795649340559702393-2.json.
-
All nine nonempty discussion keys were assessed exactly once; see discussion-assessment.json and receipt checks/1795649331988680247-2.json. The frozen diff passed git diff --check.
Limitations:
-
The takeover reproduction used an embedded LogService, synthetic WAL entries, an injected delay, and a shortened close timeout; it was not a live TN failover or SQL transaction.
-
Full package suites and race tests were not run in this attempt. The author's reported macOS and race results were not accompanied by retained logs in local_validation.
-
No released-artifact upgrade or restore execution was performed for the changed LogService read behavior.
|
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: b7a6d35b6b2558dd126d55194a40b2db9cfc3115
Assessment: request_changes
The WAL changes reuse the existing queues and lease mechanism, but the per-factory lease claim does not enforce the current TN shard assignment. The earlier cross-host fencing concern remains open through a stale-restart path. The change also needs the required released-data replay validation.
Model: gpt-6.1-terra / max
Session: 01a21559-2c14-7273-a4d2-83e9387fd8ce · slot 2 · generation 5
-
P1
pkg/logservice/client.go:172: After replica A has been replaced by replica B, A restarts with its old shard assignment in local TN metadata and creates a fresh writer factory.
Impact: A can reclaim B’s LogService lease. B cannot reclaim it through its already-claimed factory, so B’s next WAL append receives ErrNotLeaseHolder and the driver fail-stops the healthy TN process.
Evidence: TN startup loads persisted shards and starts them before its heartbeat loop (pkg/tnservice/store_metadata.go:34 and pkg/tnservice/store.go:221). The LogService state machine accepts a normal lease update without checking the current shard owner (pkg/logservice/rsm.go:240). TestReviewRetryFactoryCanReclaim deliberately asserted the takeover and successor rejection; it passed in lease-probe-mirror.log, receipt checks/1795655807720193337-3.json. The new clientpool.go:208 stops retrying on that rejection. Fence new and delayed claims against authoritative shard ownership, and cover the stale-startup path. -
P2
pkg/logservice/store.go:1219: A shutdown upgrade retains a released 4.2 Raft log containing lease changes and rejected user proposals.
Impact: The candidate reclassifies those persisted proposals as LeaseRejected and WAL replay skips them. The required released-artifact check is missing, so preservation of accepted records, replay positions, and subsequent writes has not been verified across this upgrade boundary.
Evidence: The published v4.2.9 implementation exposed every user proposal as UserRecord; the new implementation uses persisted lease history to filter some of them. The current tests create the history on the candidate, and evidence.json.local_validation contains no released-data run. The pinned upgrade-compatibility policy requires a real released artifact for a reachable change in interpretation. Run a focused v4.2.9-to-candidate restart/replay check with accepted and rejected proposals across a lease handoff, then verify a subsequent write.
Validation:
-
Private-runtime preflight passed; receipt checks/1795654733865266385-3.json. The retained native build matched 173 current inputs; receipt checks/1795654754697429374-3.json.
-
Six focused LogService tests and controls passed, including the review-only lease probes; lease-probe-mirror.log and receipt checks/1795655807720193337-3.json.
-
Fourteen focused data-sync, WAL driver, Store, and DB lock tests passed; focused-tests.log and receipt checks/1795655956653978633-3.json.
-
Nine selected lifecycle tests passed once under the race detector; focused-race.log and receipt checks/1795656227158212548-3.json.
-
The changed TN factory and manifest fixture tests passed; focused-fixtures.log and receipt checks/1795656273699995029-3.json.
-
The v4.2.9 release resolves to 6c05e42. Its RSM and persisted proto match the merge base, as do those of the 20261124 hotfix; this was a source comparison, not an upgrade execution. Receipt: checks/1795656259622109003-3.json.
-
The final audit matched the claimed test results to receipts and logs, verified all 11 discussion keys, and found the source checkout clean; final-evidence-audit.log and receipt checks/1795656365361157425-3.json.
Limitations:
-
The stale-restart failure was demonstrated with an embedded LogService and independent factories; a live TN failover was not run.
-
The recovery-fence rejection probe overlaps TN startup with WAL recovery, which pkg/logservice/config.go:218 prohibits. It is not reported as a supported-deployment defect.
-
Full owning-package suites, adaptive race stress, and a released-data upgrade or restore were not run. The author’s reported macOS results had no retained logs in local_validation.
-
The first-attempt probe timed out during dependency download and was not counted as a pass.
|
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: 2ce74a45228d47571ce6eda06446a1f8454919a5
Assessment: request_changes
The assignment epoch and existing LogService lease state provide a coherent cross-host fence, and the earlier stale-restart and standby-reader concerns have targeted fixes. Two availability issues remain in WAL startup: the pool retries a permanently cached claim error, and replica cancellation does not interrupt the new HAKeeper-dependent claim path.
Model: gpt-6.1-terra / max
Session: 01a214fd-5519-75c1-ba9a-e15d93ce4077 · slot 1 · generation 16
-
P2
pkg/logservice/client.go:177: A TN lease claim is dispatched but its response is lost, and the LogService connection subsequently recovers.
Impact: The factory permanently returns the original error, but every WAL client-pool worker continues reconnecting and retrying it. With the defaults, WAL startup can remain unavailable through approximately five minutes of retries despite recovery, while producing repeated connections and errors.
Evidence: The factory caches the dispatched error at lines 177–179; clientpool.go:124–160 retries errors other than ErrNotLeaseHolder, and openClientPool waits for all workers at line 289. The retained overlay probes show the original factory continuing to return the injected error, a fresh factory for the same owner succeeding in the standalone test, and four pool attempts for an ambiguous error versus one for a lease rejection. Make the cached ambiguous result terminal to the pool so the existing outer startup retry can create a fresh factory, while retaining assignment and epoch fencing. -
P2
pkg/logservice/client.go:158: HAKeeper is unavailable while a replica is opening its WAL, the LogService shard remains reachable through configured service addresses, and the TN is asked to stop.
Impact: Canceling replica startup does not cancel the claim or the pool's retries, so store shutdown can wait through the approximately five-minute pool retry budget and retain the DB writer lock meanwhile.
Evidence: The new claim reads HAKeeper state in service.go:463–466, but its timeout is rooted in context.Background here. DB.Open calls WAL pool initialization without the replica context, clientpool.go:124–159 retries without cancellation, and store.go:237–245 waits for the startup task after canceling it. The older direct-address connect proposed the lease through the LogService shard, so a HAKeeper-only outage is a new trigger for the preexisting uncancellable retry behavior. Propagate startup cancellation through the claim and pool initialization, or make their wait cancellable by an equivalent mechanism.
Validation:
-
Private-runtime preflight passed: checks/1795664065050698150-5.json and preflight.log.
-
Eight focused LogService and WAL-driver regression tests passed, including stale and delayed claim fencing and shutdown deadlines: checks/1795665810499483186-2.json and focused-regressions.log.
-
Two diagnostic overlay probes passed for the cached-claim and pool-retry behavior: checks/1795665624571934747-5.json and retry-probes.log. The claim probe uses the standalone test's no-HAKeeper fallback.
-
The supplied patch matched the frozen checkout after newline normalization, and git diff --check passed: checks/1795665394863851200-6.json and checks/1795664065050422625-5.json.
-
The exact-head evidence snapshot records successful Ubuntu unit tests and the required CI check. The discussion assessment covers all 13 indexed discussion keys.
Limitations:
-
A broader local test command timed out during compilation; it is not counted as a test result. Shutdown during a HAKeeper-only outage was established by source tracing rather than an end-to-end local test.
-
The author reports a v4.2.9 released-artifact replay and additional Darwin and race tests, but their underlying logs were not supplied in local_validation and were not rerun here.
|
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: 440d9f2b70ee0142388d9ba6e6d302577d38d2e5
Assessment: request_changes
The earlier lease-fencing, waiter-completion, and startup-retry concerns have targeted fixes. The design extends the existing HAKeeper assignment and LogService lease owners to fence cross-host writers, while retaining the local lock during asynchronous WAL shutdown. One startup cancellation path remains blocked when the RPC writer stalls.
Model: gpt-6.1-terra / max
Session: 01a21639-12a3-7733-847d-d3754a735f2c · slot 1 · generation 17
- P2
pkg/logservice/client.go:195: A TN replica is canceled while its dispatched CLAIM_TN_LEASE request is waiting for a stalled MORPC writer.
Impact: Client-pool initialization waits for the blocked request, so DB.Open retains its writer lock and TN shutdown waits for the startup task. A stalled socket can delay cancellation until the original connection deadline, which defaults to 30 seconds; a writer that does not complete can delay it longer.
Evidence: requestWithDispatch waits in Future.Get, and morpc.Future.waitSendCompleted waits unconditionally for the writer when no request-release callback is configured. The existing cancellation test releases its injected writer on ctx.Done, so it does not cover this case. A review-only DB.Open probe held the writer independently and observed that cancellation did not return until the writer was released; see writer-cancellation-retry.log and checks/1795672630270246866-2.json. Make send completion and client teardown responsive to cancellation while retaining ownership of the pooled request until the writer is finished, and cover a writer that remains stalled after cancellation.
Validation:
-
Private runtime preflight passed; see preflight.log and checks/1795671976725585515-2.json.
-
Eleven selected LogService, WAL-driver, and WAL-store tests and two DB cancellation/lock controls passed on the assigned head; see focused-tests.log, db-controls.log, and their corresponding checks/1795672741701775851-2.json and checks/1795672706017339432-2.json receipts.
-
The diagnostic overlay probe passed by reproducing the blocked cancellation; it does not represent a product-path pass.
-
The diff whitespace check passed. The final audit matched the claimed checks to receipts and logs, verified all 15 discussion keys, and confirmed the source checkout was clean; see final-audit.log and checks/1795672939739216470-2.json.
-
The frozen CI snapshot records successful Ubuntu unit and coverage checks and successful proxy and pessimistic multi-CN BVT checks.
Limitations:
-
The cancellation probe stalls an injected MORPC backend filter; no live socket-stall or distributed TN failover was run.
-
The PR reports a v4.2.9 released-artifact replay at the previous head, but its underlying log was not supplied. Release compatibility CI was skipped.
-
The first local compilation attempt was interrupted while the default module proxy stalled and is not counted as a test result.
|
Addressed the stalled RPC writer finding in MORPC keeps ownership of the request through send completion for The |
|
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: 38834152fae7a9c8e846a7aa7ddea545a65ae229
Assessment: approve
The WAL changes reuse the existing queues and extend the existing assignment and lease owners to fence stale writers during asynchronous drain. The prior findings on waiter completion, writer fencing, standby connections, retries, and startup cancellation are addressed.
Model: gpt-6.1-terra / max
Session: 01a21456-006d-7b41-b150-908a3e9d9152 · slot 3 · generation 6
Validation:
-
Private-runtime preflight and git diff --check passed; receipts 1795678753801654260-2.json and 1795678753801283057-2.json.
-
Two current-head DB tests passed, including cancellation with each of the three startup RPC writers stalled and retention of the writer lock through WAL shutdown; db-focused.log and receipt 1795679112663453424-2.json.
-
Fourteen current-head LogService, WAL driver, and WAL store tests passed, covering stale claims, failed-group completion, retries, and shutdown deadlines; focused-regressions.log and receipt 1795679267367289340-2.json.
-
The frozen CI snapshot reports successful Ubuntu unit, coverage, and multi-CN proxy and pessimistic BVT checks. The upgrade compatibility jobs were skipped.
-
The author reports a v4.2.9 released-artifact replay at 2ce74a4 covering accepted and rejected proposals, a subsequent write, and a second replay. The relevant persisted-read and replay files are unchanged at this head.
Limitations:
-
The released-artifact replay log and the author's reported Darwin package and race-test logs were not supplied in local_validation.
-
No live multi-node TN/LogService failover or independent released-artifact replay was run in this review.
|
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: 21ddc1c9b79c945a5b3286459b3bef6b026a40eb
Assessment: approve
The change reuses the existing WAL queues and extends HAKeeper assignment and LogService lease ownership to fence stale writers during asynchronous shutdown. The earlier findings on waiter completion, standby attachment, retry behavior, and startup cancellation are addressed. No actionable findings remain.
Model: gpt-6.1-terra / max
Session: 01a21acc-536c-77a3-818d-e4cc04ff8653 · slot 2 · generation 8
Validation:
-
The frozen CI snapshot reports successful Ubuntu unit, coverage, and multi-CN BVT jobs on the assessed head.
-
Private-runtime preflight passed; receipt checks/1795753814628778479-2.json and preflight.log.
-
The diff whitespace check passed; receipt checks/1795754026870277403-2.json and diff-check.log.
-
The audit verified the frozen head, clean checkout, supplied patch identity, and coverage of all 20 discussion keys; receipt checks/1795754245692462712-2.json and review-audit.log.
Limitations:
-
The author reports a v4.2.9 released-artifact replay on an earlier head, including a subsequent write and second replay. The relevant persisted-read and replayer files are unchanged, but the raw replay log was not supplied.
-
No local Go tests or live multi-node TN/LogService failover were run in this review. The release compatibility CI jobs were skipped.
🚫 Left the queue · queue conditions no longer match33 min in the queue, with no time running CI. So far
Reason Pull request #33209 has been dequeued Queue conditions are not satisfied:
To get back in the queue
Requeue requested — the merge queue status continues in this comment ↓. Times in UTC · dashboard · how the merge queue works |
…28014) - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Code Refactoring issue matrixorigin#28013 Related to issue matrixorigin#27945. An accepted TAE WAL entry can wait indefinitely when serialization, callback, client acquisition, worker submission, or LogService append fails before the normal commit wait loop publishes its terminal state. Driver shutdown can also consume two independent timeout windows and then enter another unbounded wait. - Make `groupCommitter` the single completion owner for every accepted entry in the group. - Complete accepted waiters exactly once for success and every pre-append/append failure path, then clear the owned entry list so reset and close cannot notify twice. - Preserve the existing ordered success notification and committed-DSN behavior; failed committers do not advance the committed watermark. - Keep ants worker submission non-blocking for close safety, but retry `ErrPoolOverload` during normal worker handoff until the worker is reusable; `closeC` aborts that retry during shutdown. - Return clients and balance pending accounting on rejected or close-aborted submission. - Start one shared four-minute close deadline before stopping intake and use it for both worker and waiter drains; do not perform an unbounded second wait after expiry. - Propagate a WAL close error through TAE DB and TN replica shutdown so the service layer can fail-stop before closing LogService. - Keep the existing append-error fail-stop and unknown-commit semantics. - This PR is independent of PRs matrixorigin#28015 and matrixorigin#28016. - No SQL, DDL, public API, WAL format, transaction wire protocol, persisted format, or unknown-commit contract change. - This PR does not reorder standalone services or implement TN RPC quiesce/drain. - Exact PR base/head: `ffc8d9f0625c76e87ba967984ce19db2d082b0ba` → `3b261e26737c3834ec71699c842bbb16bcca2c12`. - The final revert commit changes no files relative to the repaired tree `6d7c8be5988f0afcc994662dd1cdeb21f74091c7`; the net PR diff is 7 files, 537 insertions, and 35 deletions. - `mo-cgo-test -list` names all three new lifecycle tests; each focused test passed under `-race -count=10`: `TestCommitSubmissionWaitsForWorkerHandoff`, `TestSubmitCommitWaitsAfterCommitterCompletion`, and `TestCloseDeadlineIncludesIntakeAndWorkerDrain`. - The full `pkg/vm/engine/tae/logstore/driver/logservicedriver` owning-package race run passed at the same repaired tree. - `git diff --check` passed; semantic preflight schema v6 passed at this exact head with diff hash `f871859479cb5b9f8578b97b69113ce224c930719ab871339582024859e42115`. - BVT: N/A — SQL BVT cannot deterministically inject WAL serialization, client acquisition, worker submission, or LogService append failure and then assert the internal waiter terminal before fail-stop. - CI for the current exact head is running; no current CI or QA closure is claimed here. - QA required: yes. - Reason: this changes durability waiter completion, fail-stop, close-race, hang, and unknown-commit boundaries. - Production entrypoint: accepted TAE group commit encountering an internal pre-append or LogService append terminal while the driver is running or closing. - Automated terminal coverage: package/race tests include the production commit/wait loop and injectable failure terminals, plus deterministic worker-handoff coverage for the P1 repair. - Remaining before merge and issue closure: required human code review; include this head in the A+B+C integration branch lifecycle check. This PR is Ready for review. Human review, current CI, and the integration lifecycle check remain required before merge and issue closure. --------- Co-authored-by: 大雾重重 <[email protected]> Co-authored-by: XuPeng-SH <[email protected]> (cherry picked from commit b5cdcac)
✅ Merged into
|
What type of PR is this?
Which issue(s) this PR fixes:
Related to #28013 and #27945. Backports #28014 to
4.2-dev.What this PR does / why we need it:
Complete accepted driver wrappers and transaction-owned WAL entries exactly once on failure. Both wait paths release the error only after the whole failed group has been notified, and the Store skips failed entries when recording DSNs. Preserve ordered successes and the commit watermark and return clients on rejected submissions.
Reject new appends after close before acquiring the admission mutex. Recheck close state under the mutex before accepting an append that overlaps shutdown.
Start one shutdown deadline before the WAL store drains accepted appends. The deadline covers store queues, driver intake, workers, waiters, and the truncate queue. The store detaches its append queue under the admission mutex and drains each producer before stopping its consumer. A timeout cancels truncate RPCs and leaves cleanup with the owner of each in-flight operation so an append keeps its client and its actual durability outcome. TAE retains its writer lock until the WAL signals shutdown completion. The process reserves the canonical lock path before opening a file descriptor because POSIX record locks are process-scoped. A replacement using the same working directory cannot replay or accept writes until the prior owner's WAL has drained and released the lock.
HAKeeper records the assigned TN replica and the Raft index of its assignment. LogService checks that assignment at writer startup and applies the epoch in its Raft state machine. A stale replica restarting from disk or submitting an earlier authorized claim cannot take over an already-established newer lease. Subsequent pooled clients and reconnects attach without changing writer ownership. Before the first recorded assignment on a released shard, the incumbent can resume using the current lease or the last surviving writer in lease history.
The TN checker uses the recorded assignment when retiring old replicas, and TN applies a replica-specific removal only to the matching identity. WAL startup returns a lease rejection through the DB open path and closes partially created clients. TN removes the rejected local startup assignment while its other replicas can continue. An uncertain dispatched claim ends retries for that client factory before another connection is opened. TN's outer startup retry can then create a fresh factory and check the authoritative assignment and lease epoch. The replica startup context reaches shard discovery, connect, the lease RPC, pool initialization, and retry backoff. Canceling startup closes the partial pool and releases the DB writer lock. Shard discovery, read-only attach, and fenced lease claims carry no caller-owned payload. Their RPC writer owns the request until send completion. Canceled startup leaves the unused transport to finish closing independently. A dispatched lease claim can still have an uncertain outcome and retains the existing assignment and epoch checks.
LogService reads use one Raft lookup for the applied index and lease history, preserving the physical position of rejected proposals and omitting their WAL payloads.
Standby data sync explicitly opens its upstream reader in read-only mode. LogService also handles a legacy zero-TN-ID CONNECT as an availability check, preserving an active writer's lease. The unowned standby shard still accepts and returns standby records.
Truncated-LSN retries now keep the caller's context for backoff and use a separate timeout for each RPC. The worker-handoff regression treats any worker panic as a failure and verifies both records reached LogService.
At
21ddc1c9b79c, shard discovery opts into writer ownership at its direct RPC send. The previous head timed out in the blocked shard discovery cancellation test in both Ubuntu unit-test jobs. On darwin/arm64, the WAL startup cancellation regression and focused shard discovery tests passed three runs with the race detector. Both affected packages passedgo vet.Previous head
38834152fae7a9c8e846a7aa7ddea545a65ae229passed the MORPC, LogService, TN service, TAE DB, andlogstore/...package suites on darwin/arm64. Targeted-racetests passed three runs.go vet,molint, andgit diff --checkpassed.TestCanceledWALStartupReleasesWriterLockstalled each ofGET_SHARD_INFO,CONNECT_RO, andCLAIM_TN_LEASEindependently of the startup context. All three reproduced the cancellation timeout on440d9f2. On the fix,DB.Openreturnedcontext.Canceledand a second opener acquired the writer lock before the transport writer resumed. The writer still saw the original request when released.Previous head
440d9f2b70ee0142388d9ba6e6d302577d38d2e5passed the LogService, TN service, data-sync, TAE DB, andlogstore/...package suites on darwin/arm64. Embedded publication and Iceberg SQL smoke tests, scoped lint,go vet,make err-check, andgit diff --checkpassed. A dispatched claim with a lost response made one pool attempt. A fresh factory could write, and the old factory returned its retained error without opening a transport. The cancellation test used a lease RPC writer that resumed when the context was canceled, then verified that another opener could acquire the writer lock. The backoff regression cancels after the pool worker enters its retry wait.Previous head
2ce74a45228d47571ce6eda06446a1f8454919a5passed the HAKeeper, LogService, data-sync, TN service, TAE DB, andlogstore/...package suites on darwin/arm64. Targeted-race, embedded publication and Iceberg SQL smoke tests,make err-check, changed-lines lint, andgit diff --checkpassed. The focused tests cover a lower-ID successor, predecessor startup and delayed claims, a retired heartbeat, a late replica removal, and client cleanup on a rejected startup.Released-artifact shutdown replay passed at
2ce74a4using the official v4.2.9 Linux/arm64 asset at6c05e42. Its SHA-256 matched4781ee7eb01f5d601498b819a093dbeb00d7620f48ba7f34cc974a7585a94eee. The released server persisted two accepted WAL entries at PSNs 4 and 7 and an old writer's rejected proposal at PSN 8. After shutdown, the candidate binary on darwin/arm64 opened those Raft files under its hostname-specific directory. It retained PSNs 4 and 7, returned PSN 8 asLeaseRejectedwith no payload, rejected the predecessor's fresh claim, and replayed DSNs 1 and 2. It then acknowledged DSN 3 at PSN 12 and replayed all three accepted payloads on a second WAL open. The archived released data has SHA-256cd865cf1c34b08083342c71580580aea534700b27a14303bf887a2e2e5e1c52b.At
759eb54d, the stale TCP reconnect, read paging, and WAL close tests passed under-race. Restoring the previous LogService read implementation makes the reconnect regression expose the rejected proposals as user WAL. The prior heade8099d2passed the TAErpcanddbsuites and the group failure and transaction-waiter race regressions. The failure regression proves that both Store entries complete with the backend error, no DSNs are recorded for the failed group, and a first waiter cannot return until the second entry has been notified. The close regression holds the admission mutex and verifies that a post-close append returnssm.ErrClose. The mock LogService replacement test rejects a new writer while an append is in flight, then replays that append and verifies that the two persisted records have DSNs 1 and 2. The WAL close error usesmoerr.AttachCauseand remains identifiable ascontext.DeadlineExceeded. The shutdown tests cover a blocked append and a second accepted append throughStoreImpl.AppendEntry, saturated driver intake, and an in-flight remote truncate. They also verify cleanup after the blocked operation returns.TestManifestHTTPActiveGenerationLifecyclenow uses separate storage directories for the two concurrently registered databases. The fixture continues to verify that closing the old generation leaves the new registration active.BVT: N/A for the internal fault matrix. SQL cannot inject WAL worker failures, set HAKeeper assignments, or stall the LogService RPC writer. The focused Store, driver, and LogService tests verify those boundaries and the released-data fixture verifies the post-upgrade replay and write.
QA required: yes. Live multi-node TN/LogService failover and recovery remain release validation. Use a coordinated shutdown for this upgrade. The versioned lease claims require candidate LogService replicas, and mixed-version LogService operation has no validation here.