Skip to content

Keep heartbeat cleanup out of an active sliced release - #188

Open
viktor-ferenczi wants to merge 1 commit into
codex/se-1908-occupied-handoverfrom
codex/se-1908-release-ownership
Open

viktor-ferenczi wants to merge 1 commit into
codex/se-1908-occupied-handoverfrom
codex/se-1908-release-ownership

Conversation

@viktor-ferenczi

@viktor-ferenczi viktor-ferenczi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The registry commits a handover before the source finishes closing its old grids. A heartbeat can report the lost ownership during a sliced release. The stale-ownership handler then closes every remaining grid in the same simulation update, bypassing release.closePerFrame.

The source now defers a queued discard while a release of the same partition and generation is active. Other partitions continue through the queue. A failed release gives the discard another chance on the next update. Fencing and termination still allow immediate cleanup.

Verification

P3-HND-RELEASE-OWNERSHIP transfers 144 grids with release.closePerFrame=1. The release spans multiple real registry heartbeats. All 144 grid IDs reached the destination in both runs.

Source result Before After
Grids closed by the capped release 18 144
Empty close callbacks 126 0
Grids closed per nonempty callback 1 1

The existing fenced-node recovery scenario P1-REC-16 also passed. The old node discarded its doomed copies and exited, and the other node recovered the original station in the correct partition.

An occupied replay caught the same race on a larger partition. The source logged its stale-ownership purge at the end of a 506 ms simulation interval, with only 0.1 ms in that frame's release callback. In two earlier warm transfers with a cap of four, the longest simulation intervals during release were 506 and 252 ms.

One warm repeat with this change closed 106 roots across 28 nonempty batches. Its longest source interval during release was 193.5 ms. The destination accepted client traffic at 5.009 s and the source finished at 6.049 s. The moving client's local P99/maximum update intervals were 24.1/24.7 ms. The destination bystander's were 41.7/43.9 ms, between the earlier warm single-worker results of 31.5/33.0 and 45.0/55.3 ms. The queue regression establishes the fix. The player measurements come from one warm fixed run on a changing partition. SE-1908

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.

1 participant