Repository navigation
fix: avoid remote lock stale bind hangs - #24206
mergify[bot] merged 12 commits into
Conversation
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR addresses a lockservice hang scenario caused by stale remote lock binds by ensuring remote lock/forward-lock RPC responses don’t leave requesters stuck waiting, and by improving stale-remote-holder cleanup using bind-scoped heartbeats.
Changes:
- Switch remote lock / forward lock result responses to bounded synchronous writes (deadline-based) to avoid requester hangs in
Future.Get(). - Track and validate remote keepalive at bind granularity, and send
KeepRemoteLockheartbeats per bind (not per remote service). - Add regression tests for sync writes with deadlines, stale bind cleanup, and multi-bind keepalive refresh.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/lockservice/waiter_events.go | Adds bind-level remote-heartbeat gating to orphan cleanup during waiter checks. |
| pkg/lockservice/txn_test.go | Updates newWaiterEvents construction to pass remoteLockTimeout. |
| pkg/lockservice/service_remote.go | Uses deadline-based response writes for remote/forward lock paths and records bind heartbeats for remote locks. |
| pkg/lockservice/service.go | Extends activeTxnHolder for bind-level heartbeat tracking and implements it in mapBasedTxnHolder. |
| pkg/lockservice/rpc.go | Introduces writeResponseWithDeadline and a default RPC write timeout. |
| pkg/lockservice/rpc_test.go | Adds a focused test ensuring writeResponseWithDeadline uses sync Write() with a deadline. |
| pkg/lockservice/orphan_txn_test.go | Adds tests covering bind-heartbeat-missing unlock and multi-bind keepalive refresh behavior. |
| pkg/lockservice/lock_table_keeper.go | Changes keep-remote-lock heartbeats to be sent per bind rather than per service. |
| pkg/lockservice/lock_table_keeper_test.go | Updates newWaiterEvents call signature in keeper tests. |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Merge Queue Status
This pull request spent 28 minutes 53 seconds in the queue, with no time running CI. Waiting for:
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks HintYou may have to fix your CI before adding the pull request to the queue again. |
Merge Queue Status
This pull request spent 31 minutes 2 seconds in the queue, with no time running CI. Waiting for:
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks HintYou may have to fix your CI before adding the pull request to the queue again. |
Merge Queue Status
This pull request spent 33 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #24205
What this PR does / why we need it:
morpc.Future.Get()after the owner has already taken the lockKeepRemoteLockheartbeats per bind so multiple remote tables on the same peer are all refreshed