Skip to content

fix(logservice): recover stalled reads and replica delivery - #33073

Open
jiangxinmeng1 wants to merge 14 commits into
matrixorigin:mainfrom
jiangxinmeng1:codex/fix-32934-32933-32919-32916-32912
Open

jiangxinmeng1 wants to merge 14 commits into
matrixorigin:mainfrom
jiangxinmeng1:codex/fix-32934-32933-32919-32916-32912

Conversation

@jiangxinmeng1

@jiangxinmeng1 jiangxinmeng1 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Fixes #32934
Fixes #32933
Fixes #32919
Fixes #32916
Fixes #32912

What this PR does / why we need it:

  • Retry GetWALTruncate through bounded reads and client rediscovery when an existing connection stops responding, while honoring the caller deadline.
  • Retain LogService StartReplica commands after a lost heartbeat response until the exact replica and voting role are reported. Keep delivery IDs stable and fence retries against current membership and store incarnation; suppress duplicate local starts and cancel superseded commands.
  • Use concrete LogService service addresses from gossip and HAKeeper to find candidate peers. Treat HAKeeper state as peer discovery only: a persisted data replica is skipped only when a peer returns quorum-backed Raft membership that excludes its ID. Include voting and non-voting replicas in this membership check. If quorum is unavailable, preserve the local replica; when multiple persisted data replica IDs share one store and shard, start the newest local ID to avoid a duplicate-shard startup failure.
  • Pass the caller context into NewClient shard discovery so cancellation stops a stalled connection promptly.
  • Stop TN WAL Append retry backoff on parent-context cancellation while preserving an append result that completes concurrently.

Regression tests cover a blackholed LogService read, lost heartbeat response, matching stale gossip views after a committed voter ADD, a stale HAKeeper shard report before the next heartbeat, a seed that does not host the shard but advertises a voter's service address, preservation when no peer or quorum answers, legitimate non-voting membership, non-voter-to-voter replacement on one store with and without quorum, cancellation after a silent discovery connection is accepted, and TN Append retry cancellation.

Validation after merging upstream/main at 383c17fb4b: full LogService, HAKeeper, HAKeeper checker, and TN LogService driver package tests; selected -race recovery, command-delivery, and cancellation tests; go vet for those packages; and git diff --check. All passed. After merging the newer upstream/main at d4a41b466c, the full LogService package passed normally and with -race; the new mixed-role restart test passed five -race runs, four focused regressions each passed 100 -race runs, and LogService go vet passed. Four key startup tests passed again on the final commit.

Review follow-up: A removal merely placed in a heartbeat response no longer deletes a retained Start. The Start keeps its command ID and can be redelivered if that response is lost or removal fails; the same batch still suppresses a conflicting Start. A later heartbeat reporting a higher shard epoch retires the Start when the replica is absent from voting or non-voting membership. Stop and Kill still fence Starts at admission. Regressions cover a returning target, a lost removal response, same-batch suppression, and confirmed removal in both voting roles. After merging upstream/main at a277d62e7b, the full HAKeeper, HAKeeper checker, and LogService package suites passed; four affected tests passed -race -count=20; HAKeeper go vet and git diff --check passed. New CI is pending.

The new read-only membership RPC is bounded to one second. An older peer that does not support it, or a cluster without quorum, leaves removal unconfirmed; startup then preserves the local replica, and normal HAKeeper cleanup can retire a removed one later. Discovery-only startup uses the HAKeeper leader state to find peer service addresses; only quorum-backed Raft membership confirms removal.

Review follow-up (2026-12-02)

  • Keep the failed peer history for the whole WAL read retry even when discovery temporarily omits a peer. A reappearing failed peer no longer goes ahead of an untried voter; the all-failed fallback remains available.
  • Added a rotating-view retry regression (B,C then A,C) and kept the existing all-failed fallback test. Focused tests and focused race tests passed; go vet ./pkg/logservice passed. Merged upstream main at f9d52a3a39.

Review follow-up (2026-12-03)

  • After every discovered voter has failed a WAL read, retry peers in order of least recent read failure. Each previously failed peer gets a bounded CONNECT attempt, so a recovering follower can win even when the stale leader accepts CONNECT faster. The regression covers changing discovery views and a slower recovered follower.
  • Merged upstream main at 66002aa3fd into head 2ce552160b. On this head, the full LogService package passed; two focused retry regressions passed -race -count=20; git diff --check passed. CI is running. The preceding CI run failed three CHECK-constraint BVT expectations that main fixed in test(sql): align ODKU CHECK cases with input validation #33691 before this merge.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

@XuPeng-SH

XuPeng-SH commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 60df9abaed8250a8ba446b023e2838f8d655a9a9

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 60df9abaed8250a8ba446b023e2838f8d655a9a9

Assessment: request_changes

The deadline, retry, and startup changes reuse the existing client and recovery paths. The retained Start queue also restores delivery after a lost heartbeat response, but it can resend an old Raft identity to a replacement disk after HAKeeper has recorded the new store incarnation.

Model: gpt-6.2-sol / xhigh

Session: 01a20682-9189-75a0-839a-f36d8b2372a5 · slot 1 · generation 3

  • P1 pkg/hakeeper/rsm.go:872: An ordinary LogStore Start remains pending after its committed heartbeat response is lost. The store then returns with the same UUID on a replacement disk and sends its first heartbeat before the checker schedules retirement.
    Impact: The replacement disk can start an empty Raft replica under the old replica ID. Peers may reuse replication progress acknowledged by the previous disk, bypassing the existing fence for safe replica replacement.
    Evidence: The heartbeat records the new StoreIncarnation at rsm.go:1163 before reading the queue at rsm.go:1196. Delivery checks whether the replica is already running, while pkg/hakeeper/checkers/logservice/parse.go:170 already rejects Starts for a known incarnation mismatch. The snapshot-restore probe returned the same command ID to the original disk as intended and also returned the old Start to the replacement disk. Apply the existing membership and incarnation fence before emitting a retained ordinary Start, while preserving retries for the original disk.

Validation:

  • Verified the frozen head, merge base, patch, whitespace, and native build inputs. Private /tmp and loopback preflight passed. Receipts 1795418678976930580-2.json and 1795418678777390956-2.json.

  • All 27 selected top-level race tests passed across HAKeeper, LogService, and the TN logservice driver. Receipt 1795419105802731932-2.json and focused-race.jsonl.

  • The isolated HAKeeper race probe passed the same-disk control and reproduced delivery of the stale Start after snapshot restore. Receipt 1795419341274759564-2.json and retained-start-generation-final.jsonl.

  • Static comparison verified the relevant persisted fields against v4.2.8 and its 20261114 hotfix, and confirmed that the PR preserves the target base's command writers and snapshot codec. Receipt 1795419328596876739-2.json and release-compat-verified.log.

Limitations:

  • The replacement-disk probe verified command delivery through HAKeeper. It did not start Raft on a replacement disk or measure downstream effects.

  • Release compatibility was checked statically. No shutdown upgrade was run.

  • The broader short race run recorded passes for all three packages, but its receipt timed out while fingerprinting the source. It was excluded from validation matched to the frozen head.

@XuPeng-SH

XuPeng-SH commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 4ef47088f83ad54b2cd94036e73101318c4ee92d

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 4ef47088f83ad54b2cd94036e73101318c4ee92d

Assessment: request_changes

The retained Start queue reuses existing HAKeeper state, and quorum-backed membership reads provide an appropriate authority for startup decisions. The earlier incarnation-fencing and cancellation concerns are addressed. Three startup gaps remain: discovered peers are dialed by UUID, discovery-only startup can trust a stale shard report, and same-store replacement is incomplete across voting roles. The latter two extend previously reported failure classes.

Model: gpt-6.1-terra / max

Session: 01a229e8-c998-7480-862c-3017417a9175 · slot 1 · generation 38

  • P2 pkg/logservice/store.go:432: A configured HAKeeper service-address seed does not host the data shard, but its gossip response advertises reachable shard voters.
    Impact: The quorum-backed membership check cannot reach those voters and treats a genuinely removed local replica as unconfirmed, so startup can reopen it even though the surviving quorum could confirm its removal.
    Evidence: getShardMembership returns ReplicaInfo.UUID values, but this loop treats them as service addresses. In real-membership-probe.log, a real non-member seed advertised a voter with a valid service address; the subsequent RPC dialed its UUID and failed with a missing-port error. Querying the voter directly confirmed the removal. Carry the advertised ServiceAddress into peer discovery while retaining UUIDs for membership identity.

  • P2 pkg/logservice/store.go:383: A discovery-only store restarts a newly added data-shard voter before a heartbeat has updated HAKeeper's LogState with the committed Raft membership.
    Impact: Startup classifies the live voter as removed and skips it, leaving the shard without that voter and vulnerable to losing quorum if another voter fails. This pre-existing stale-report failure remains within the claimed fix for issue #32919.
    Evidence: A linearizable HAKeeper read returns the last asynchronously reported data-shard membership, not a linearizable read of that shard's Raft membership. In discovery-only-probe-control.log, HAKeeper's epoch-2 report omitted replica 3 while the committed epoch-4 membership included it; restart skipped the voter. The same disk started it after a fresh heartbeat. Confirm absence through the shard's quorum-backed membership, and treat an unavailable confirmation as unknown.

  • P2 pkg/logservice/store.go:751: A stopped, removed non-voting replica leaves local metadata, then a new voting replica for the same shard is started on that store before the old metadata is cleaned up.
    Impact: Both records remain eligible at restart because zombie classification and this new selection exclude non-voters. Starting the second replica returns "shard already exist", causing NewService to fail. This is a remaining variant of the earlier same-store replacement finding.
    Evidence: mixed-role-probe-control.log reproduces the sequence with real Raft membership changes and records the restart failure. The same disk starts the current voter after the obsolete non-voter metadata is removed. Resolve competing local records across voting roles using current membership, while preserving legitimate non-voters and the no-quorum recovery path.

Validation:

  • Private /tmp and loopback preflight passed. Current CPU cgo prerequisites were built with the repository Makefile after verifying the reusable third-party inputs and archives.

  • Fifteen selected tests passed across LogService, HAKeeper and the TN LogService driver, including retained Start fencing, blackholed WAL reads, discovery cancellation and the maintained same-role replacement control.

  • The three targeted probes failed at their expected assertions with direct-voter, fresh-heartbeat and same-disk metadata-cleanup controls passing. Full logs, commands, source fingerprints and exit receipts are reconciled in /mnt/nvme/mo-bot-55-live/state/jobs/65a1ea4ab974f786b9f147a5/attempt-1/validation-audit.json.

  • The frozen CI snapshot reports successful Ubuntu UT and SCA checks. The source checkout remained clean.

Limitations:

  • The focused probes used in-process LogService and Raft nodes; they did not measure natural production network timing.

  • The full package and race suites and a shutdown upgrade were not independently rerun.

@XuPeng-SH

XuPeng-SH commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 658ce435c15c10af10b8ff36d7cbd54096cbc432

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 658ce435c15c10af10b8ff36d7cbd54096cbc432

Assessment: request_changes

The change reuses the replicated command queue and adds a bounded quorum-backed membership check to avoid relying on stale gossip. The earlier incarnation, discovery, and mixed-role concerns are addressed. One interaction remains: admitting a removal can erase a retained Start even when the removal is subsequently rejected as stale.

Model: gpt-6.1-terra / max

Session: 01a22aff-bb68-7e31-ae71-ee4ab48ad9d0 · slot 0 · generation 45

  • P2 pkg/hakeeper/rsm.go:582: With command delivery enabled, a Start response is lost and its target store becomes expired. The checker queues a removal, but the store returns before that removal is delivered.
    Impact: Admission deletes the retained Start. The delivery guard then rejects the now-stale removal, leaving the store in membership without its replica running or its Start available for redelivery. A new Start is suppressed while the removal operator remains in flight, delaying recovery for up to its 15-second expiry and the next checker pass. Losing another voter during that window can interrupt quorum.
    Evidence: The unconditional discard at rsm.go:582 precedes the stale-removal guard at rsm.go:899-905; check.go:390-392 suppresses a replacement Start while removal is executing. The diagnostic stale-admitted-probe.log reproduces the sequence with one lost response, and stale-checker-probe.log confirms the checker behavior. Retain or restore the Start when a terminal command is rejected, while still fencing it when a removal or stop proceeds.

Validation:

  • Private /tmp and loopback preflight passed; native artifact provenance matched the candidate inputs. Receipts: checks/1796027709985184798-3.json and checks/1796027775947115314-3.json.

  • Focused isolated Go tests passed for retained-start delivery and incarnation fencing, discovery cancellation, stale-seed recovery, WAL retry, and append cancellation. See focused.log and checks/1796028025326627949-3.json.

  • In-process startup tests passed for a removed HAKeeper voter, a live voter hidden by stale gossip, committed absence, and competing non-voting replicas. See zombie-regression.log and checks/1796029001675769137-3.json.

  • The retained-start control passed and the stale-removal case failed as described; the independent checker probe passed. See stale-remove-probe-final.log, stale-admitted-probe.log, stale-checker-probe.log and their matching receipts.

Limitations:

  • The stale-removal finding was reproduced at the state-machine and checker boundaries, not in a full cluster reproduction.

  • The full repository suite, race detector, and cross-version execution were not run.

@XuPeng-SH

XuPeng-SH commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 55c8b2346958c76e91bb5306dcaf971563d4efe6

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 55c8b2346958c76e91bb5306dcaf971563d4efe6

Assessment: request_changes

The change reuses the existing command queue and client paths, and its quorum-backed membership check addresses the earlier stale-gossip concerns. The prior finding about a removal rejected before delivery is resolved, but a related lost-response window can still erase the retained Start before removal is applied.

Model: gpt-6.1-terra / max

Session: 01a22b78-8d27-7672-ac2d-c513f3728009 · slot 3 · generation 10

  • P2 pkg/hakeeper/rsm.go:995: A LogStore Start response is lost, the target expires, and a guarded removal is accepted in another store's heartbeat; that removal response is then lost, or the removal attempt fails.
    Impact: The target remains in Raft membership, but its retained Start has been deleted. When the target returns, it cannot receive that Start, and the checker suppresses a replacement while the removal operator remains in flight—up to its 15-second expiry and the next checker pass. Another voter failure during that interval can interrupt quorum.
    Evidence: getCommandBatchFiltered records a removal as delivered when it adds it to the heartbeat response, then discards matching Starts here; that does not establish that the response arrived or the removal succeeded. The service executes the command only after SendLogHeartbeat returns successfully, and handleRemoveReplica can also fail. The checker suppresses a competing Start at pkg/hakeeper/checkers/logservice/check.go:390. Retain the Start in a fenced state until removal is observed committed, and allow retry if the removal is lost or fails; add a regression for the lost-removal-response case alongside the successful-removal control.

Validation:

  • The frozen CI snapshot reports successful Ubuntu UT, coverage, and CI Required checks.

  • Private /tmp and loopback preflight passed; receipt 1796113797028427518-3.json matches preflight.log.

  • git diff --check passed for the assigned merge-base and head; receipt 1796115323744909056-3.json matches diff-check.log.

  • The finding is based on the source trace through heartbeat delivery, command execution, and checker suppression. The diagnostic test was prepared but did not compile.

Limitations:

  • No local Go tests ran: the available Go 1.26.6 is older than the repository's Go 1.27.1 requirement, and a bounded toolchain download timed out. These are environment outcomes, not product-test results.

  • The frozen CI snapshot shows the upgrade checks as skipped; no shutdown-upgrade execution was independently performed.

@XuPeng-SH

XuPeng-SH commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: ac9254674907889a2c8d96f7aec76d5fb2b5859c

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: ac9254674907889a2c8d96f7aec76d5fb2b5859c

Assessment: request_changes

Discovery-based WAL truncate retries can repeatedly select a stalled leader while healthy voters remain available. The retained-command and quorum-membership changes reuse existing owners and address the earlier incarnation, stale-gossip, replacement, and removal concerns. The new membership RPC and retained commands serve distinct recovery purposes.

Model: gpt-6.1-terra / max

Session: 01a22b07-00b6-7e32-b0a1-3099d0b867c7 · slot 1 · generation 39

  • P2 pkg/logservice/client.go:357: A client uses DiscoveryAddress, and the discovered leader accepts CONNECT promptly but does not answer GET_TRUNCATE, while other advertised voters remain healthy.
    Impact: After each bounded read attempt, reconnection selects the same leader first and can repeat until the caller's deadline. WAL replay or truncation recovery can therefore remain blocked or fail despite a healthy quorum.
    Evidence: Discovery puts the leader first at client.go:593-604, and reconnection returns the first successful CONNECT before launching a fallback at client.go:731-746. The maintained blackhole test replaces the client's reconnect addresses before inducing the failure. A three-voter overlay probe preserved discovery, injected a GET_TRUNCATE-only stall, and observed a second read against the same leader with zero follower connection attempts; a direct healthy-follower read succeeded. See wal-discovery-probe.log and receipt 1796125105947645081-3.json. Ensure a retry can try another known replica after a read failure, including in discovery mode.

Validation:

  • Private /tmp and loopback preflight passed. Native prerequisites were built from the frozen head in the diagnostic directory and their provenance verified.

  • Focused tests passed for retained starts, disk-incarnation fencing, replica startup, discovery cancellation, WAL reads, and TN append cancellation; see hakeeper-focused-native.log, logservice-focused.log, and startup-controls.log.

  • Race runs passed 100 repetitions of retained-start removal handling, 11 repetitions of HAKeeper stale-seed quorum recovery, and 100 repetitions of append cancellation during backoff.

  • The discovery failover probe failed at the expected assertion while its healthy-follower control passed; receipt 1796125105947645081-3.json records the failure.

  • The merge-base diff passed git diff --check, and the source checkout remained clean.

Limitations:

  • The failover probe used a real three-voter cluster but injected the discovery response and the method-specific read stall.

  • Full package suites and a shutdown upgrade or backup-and-restore run were not performed.

@XuPeng-SH

XuPeng-SH commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: d153d6ccf278a753ad6d205b37ac1cdf6a186cfb

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: d153d6ccf278a753ad6d205b37ac1cdf6a186cfb

Assessment: request_changes

The retained-start queue and quorum-backed membership check reuse the existing owners appropriately. The earlier retry concern is fixed for stable discovery results, but WAL read failover remains incomplete when discovery views change between attempts.

Model: gpt-6.1-terra / max

Session: 01a22b78-8d27-7672-ac2d-c513f3728009 · slot 3 · generation 10

  • P2 pkg/logservice/client.go:392: A read fails on A, discovery returns B and healthy C, the read then fails on B, and the next discovery view returns A and C. Each selected peer accepts CONNECT but fails the read.
    Impact: The client can alternate between A and B without trying C, even though C appears in every discovery result. WAL truncation metadata reads can exhaust their caller’s timeout while a healthy voter is available.
    Evidence: reconnectForRead returns only failed addresses present in the latest view, so it forgets A when that view contains B and C, then forgets B when the next view contains A and C. A three-voter GetWALTruncate probe recorded reads A, B, A, B, A, B, A while a direct read from C succeeded; the stable-view control reached C. This is a remaining gap in the intended failover fix, not a claim of a new regression from the base. Preserve read-scoped failure history across discovery responses until the available candidates have been tried, while retaining the all-failed fallback.

Validation:

  • The isolated-runtime preflight and git diff --check passed.

  • Selected maintained tests passed for retained starts, removal responses, stale-seed recovery, membership discovery, cancellation, and the existing three-voter blackhole case.

  • Selected retry and cancellation tests passed with the race detector.

  • The controlled rotating-discovery probes reproduced the finding; the stable-view and direct healthy-voter controls passed.

  • Command receipts and retained log hashes are reconciled in validation-audit.json. The discussion assessment covers all 22 indexed entries.

Limitations:

  • The three-voter probe injects discovery views and read failures; it does not represent an observed production incident.

@XuPeng-SH

XuPeng-SH commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 5806a1dccaf2d39d8cc75f8012143c64de946f5c

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 5806a1dccaf2d39d8cc75f8012143c64de946f5c

Assessment: request_changes

The quorum-backed startup check and retained Start commands reuse the existing recovery owners. One retry-liveness defect remains after all discovered peers have failed once; the earlier changing-view concern is addressed before that point.

Model: gpt-6.1-terra / max

Session: 01a2350e-851d-7031-94fc-615272373c71 · slot 2 · generation 20

  • P2 pkg/logservice/client.go:400: A discovery-based read tries leader A and followers B and C, and each read fails once. C then recovers, while A continues to accept CONNECT requests but does not answer reads.
    Impact: The same call keeps retrying A and never returns to recovered C. WAL replay or truncation recovery can therefore wait until the caller's deadline despite a healthy voter; the TN driver's default retry budget is three minutes.
    Evidence: The failed-address list is never reset or rotated. Once every discovered address is in it, reconnectForRead passes previously failed peers in discovery order to connectToLogServiceAddresses; discovery places the leader first, and a successful CONNECT selects it before fallback. A controlled probe using the exact two production retry methods observed A, B, C, A, A, A, A, A after C became healthy. Rotate previously failed peers after exhaustion while preserving failure history across changing discovery views, and cover a follower recovering after the first sweep.

Validation:

  • Private /tmp and loopback preflight passed: checks/1796222662307361017-3.json and preflight.log.

  • The extracted-production-method retry probe passed its control and reproduced the exhaustion behavior: checks/1796222882893812384-3.json and retry-probe.log. This was an internal probe with controlled discovery and connection stubs.

  • The protobuf descriptor audit and git diff --check passed: checks/1796223214307122594-3.json, descriptor-audit.log, checks/1796223221039492179-3.json, and diff-check.log.

  • The retained native build's input hashes matched the frozen source: checks/1796223008855471949-3.json and native-input-check.log.

Limitations:

  • The focused LogService package test timed out while downloading dependencies before any tests ran; it is neither a pass nor a product-test failure. See checks/1796223087835145441-3.json and focused-tests.log.

  • The probe did not run the public client against a real three-voter cluster. The package, restart, and race results reported in the PR description were not independently verified locally.

@XuPeng-SH

XuPeng-SH commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 2ce552160bf1183d77af88ade25fdd94b383d05c

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 2ce552160bf1183d77af88ade25fdd94b383d05c

Assessment: request_changes

The recovery changes reuse the existing command and membership owners, and the previously reported retry-order cases are addressed. A remaining retry regression can exhaust a caller’s deadline before reaching a recovered peer.

Model: gpt-6.1-terra / max

Session: 01a23642-a5da-74a3-9479-4bd000540084 · slot 0 · generation 54

  • P2 pkg/logservice/client.go:402: A discovery-based read receives retryable errors from A and B, then B recovers while the next CONNECT to the older failed peer A stalls. The caller has less than the five-second CONNECT timeout remaining.
    Impact: The serial retry waits on A until the caller’s deadline expires and never retries healthy B. GetTruncatedLsn, Read, and GetWALTruncate can therefore fail despite a usable voter. The merge-base GetTruncatedLsn path hedged the reconnect after 300 ms and could reach B.
    Evidence: A source-derived comparison probe used the production five-second CONNECT timeout, 300 ms hedge delay, and a 2.5-second caller deadline. The merge-base retry reached B and returned successfully in 0.6 seconds; the candidate timed out after 2.5 seconds without reconnecting to B. The candidate’s untried-peer control passed. See retry-production-timeout.stdout and checks/1796272981122921280-4.json. Reserve time for later failed peers within the remaining deadline while retaining protection against a fast CONNECT to a peer whose reads still fail, and add a regression for a stalled earlier CONNECT.

Validation:

  • Reviewed the frozen diff, linked issues, pinned policy, and all 26 discussion entries; the review plan and discussion assessment are saved in the diagnostic directory.

  • Private runtime preflight, generated descriptor audit, and git diff --check passed. Their receipts and retained logs are reconciled in validation-reconciliation.json.

  • The source-derived retry comparison produced the expected candidate failure with passing merge-base and untried-peer controls. It used stubbed discovery, CONNECT, and read behavior.

  • The supplied current-head CI snapshot reports successful Ubuntu UT, arm64 SCA, and proxy multi-CN BVT aggregate jobs.

Limitations:

  • The local LogService package test did not compile or run because the Go 1.27.1 toolchain download timed out. The retry probe is not a full three-voter RPC test.

  • A shutdown upgrade was not run. The v4.2.9 tag was unavailable locally for independent artifact comparison; the supplied earlier review reports checking that release.

@XuPeng-SH

XuPeng-SH commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: 44cc261c77a8d3d2b8ede5ac3c3d8c01079249d5

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: 44cc261c77a8d3d2b8ede5ac3c3d8c01079249d5

Assessment: request_changes

The recovery changes reuse the existing retry, command-delivery and Raft membership owners. Earlier review concerns are addressed, but the new retry budget can cancel a healthy peer before the caller’s deadline and return a read error.

Model: gpt-6.1-terra / max

Session: 01a23a4f-ba37-79e1-ad8d-cd6bacb29eeb · slot 2 · generation 23

  • P2 pkg/logservice/client.go:401: A read fails on peer A, A’s reconnect fails promptly, and an untried healthy peer B needs more than half the remaining caller budget to complete CONNECT, but can still connect and serve the read before the caller’s deadline.
    Impact: The half-budget context cancels B, and the subsequent failed reconnect to A causes the read to return an error while the caller’s context remains live. This affects Read, GetWALTruncate and GetTruncatedLsn. Keep a viable untried connection able to complete while trying alternatives, and add a regression test for this boundary.
    Evidence: In review-retry-confirm.log, the healthy-peer control completes CONNECT and GET_TRUNCATE in 1.45 seconds with a 2.4-second budget. The public GetWALTruncate path returns shard-not-found after 1.21 seconds without issuing a read to B. The diagnostic run’s expected failing assertions and passing controls are recorded in checks/1796297155937036578-3.json.

Validation:

  • Private runtime preflight and task-local native build and input-provenance checks passed.

  • Seventeen selected tests passed under the race detector across HAKeeper, LogService and the TN logservice driver, including three-voter blackhole and restart cases; see focused-race.log and checks/1796296397555007212-3.json.

  • The retry counterexample failed as expected in both an injected retry probe and the public WAL-truncate method using local RPC servers; their healthy-peer controls passed.

  • The generated protobuf descriptor audit and merge-base-to-head whitespace check passed. The review plan, discussion assessment and receipt reconciliation are saved in the diagnostic directory.

Limitations:

  • The public-method counterexample uses controlled local RPC servers and seeds the initial managed connection directly; it is not a full distributed-cluster fault injection.

  • Validation was focused on the changed recovery paths rather than full owning-package suites.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

3 participants