Skip to content

Transfer staging leases and generation-scoped pool plan cleanup - #761

Draft
yinlin09 wants to merge 2 commits into
yinlin/reshard-demand-stagingfrom
yinlin/transfer-op-leases
Draft

Transfer staging leases and generation-scoped pool plan cleanup#761
yinlin09 wants to merge 2 commits into
yinlin/reshard-demand-stagingfrom
yinlin/transfer-op-leases

Conversation

@yinlin09

Copy link
Copy Markdown
Collaborator

Follow-up to the demand-staging stack. A transfer that settles — timeout, a failed copy or push, or completion — now publishes its outcome immediately but returns its staging blocks only after every accepted copy, push, and incoming payload has drained, so late work can never touch blocks already handed to another transfer. Pool reshard plans get the same lifecycle discipline as block plans.

Commit Change
Operation leases Every accepted copy, push, and payload holds a lease on its transfer's staging; the last release frees the blocks. A failed transfer retires its uuid so a late payload cannot land at identity-addressed blocks. Destruction admits no new handlers, counts handlers and workers, unblocks accepted sockets, stops the data transport, and waits for the last callback.
Pool plan generations Pool reshard registration arms send/receive state first and publishes the plan last under the lifecycle lock, with a generation carried through settlement and timeout cleanup, so stale cleanup cannot drop a reused plan or its progress.

Both libraries build cleanly; the unit suites (including a new generation-scoped pool cleanup test) run in CI. Injection coverage that pauses a live copy or socket mid-transfer needs a live-transfer harness and is left as follow-up.

@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 38aa81e to c567f93 Compare August 24, 2026 00:29
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from 8ee40e7 to a8bd8ce Compare August 24, 2026 07:11
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from c567f93 to 18ab65d Compare August 24, 2026 07:11
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from a8bd8ce to d7e8f8a Compare August 24, 2026 07:19
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 18ab65d to f8bfbff Compare August 24, 2026 07:19
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from d7e8f8a to 2ba6523 Compare August 24, 2026 07:36
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from f8bfbff to 5ab3daa Compare August 24, 2026 07:36
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from 2ba6523 to 6c0640a Compare August 24, 2026 07:42
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 5ab3daa to 1c3189d Compare August 24, 2026 07:42
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from 6c0640a to 90c8ba3 Compare August 24, 2026 07:51
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 1c3189d to 23fcc2f Compare August 24, 2026 07:51
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from 90c8ba3 to b7b8631 Compare August 24, 2026 14:19
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 23fcc2f to 5fa008f Compare August 24, 2026 14:19
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from b7b8631 to 4db95ac Compare August 24, 2026 15:04
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 5fa008f to 173fd13 Compare August 24, 2026 15:04
A transfer that settles (timeout, a failed copy or push, or completion)
now publishes its outcome only when every accepted copy, push, and
incoming payload against its staging has finished, so neither its host
blocks nor the device pages they mirror are handed to another transfer
while late work can still touch them. A failed transfer retires its uuid
before its blocks return, so a late payload resolves nothing. Destruction
admits no new handlers, counts handlers and workers, unblocks accepted
sockets, cancels queued pushes exactly once, stops the data transport,
and waits for the last callback before tearing state down.
Pool reshard registration now arms the send or receive state first and
publishes the plan last under the plan lifecycle lock, carrying a
generation like block plans. Sender and receiver settlement, timeout
cleanup, and each copy-to-push hand-off act only on their own
registration, a failed pool receive drains like any other receive, and a
failed pool send retires its uuid, so stale cleanup can no longer drop a
reused plan or its transfer progress.
@yinlin09
yinlin09 force-pushed the yinlin/reshard-demand-staging branch from 4db95ac to beeca03 Compare August 25, 2026 04:39
@yinlin09
yinlin09 force-pushed the yinlin/transfer-op-leases branch from 173fd13 to 0b2e9d6 Compare August 25, 2026 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants