Repository navigation
[core][move semantics][4/n] Consumer raylet records which pulls are moves - #67041
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
karticam
marked this pull request as ready for review
October 15, 2026 04:44
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
karticam
force-pushed
the
karticam/consumer-learns-is-move
branch
from
October 21, 2026 05:14
69d2a94 to
3303ac6
Compare
Sparks0219
reviewed
Oct 30, 2026
Sparks0219
reviewed
Oct 30, 2026
Sparks0219
reviewed
Oct 30, 2026
karticam
force-pushed
the
karticam/consumer-learns-is-move
branch
from
November 3, 2026 03:00
3303ac6 to
85674f6
Compare
karticam
force-pushed
the
karticam/consumer-learns-is-move
branch
from
November 3, 2026 03:07
85674f6 to
10b5bda
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 10b5bda. Configure here.
karticam
force-pushed
the
karticam/consumer-learns-is-move
branch
from
November 14, 2026 02:36
10b5bda to
ab45efc
Compare
Sparks0219
force-pushed
the
karticam/consumer-learns-is-move
branch
from
November 16, 2026 00:18
ab45efc to
da8fdf6
Compare
karticam
force-pushed
the
karticam/consumer-learns-is-move
branch
from
November 18, 2026 04:07
da8fdf6 to
cc961aa
Compare
Signed-off-by: kartica.modi <[email protected]>
…BeginArgsFetch's params, and drop extra comments Signed-off-by: kartica.modi <[email protected]>
Sparks0219
force-pushed
the
karticam/consumer-learns-is-move
branch
from
November 18, 2026 07:11
cc961aa to
8a30ecb
Compare
Sparks0219
pushed a commit
that referenced
this pull request
Nov 24, 2026
…as the primary copy and reports it to the owner (#67093) This is PR 5 of a series of PRs to implement move semantics for plasma objects in core. The complete design doc is here: https://docs.google.com/document/d/1ZJhgRmwVyKfNCR21CWf6xMcc0B6HJwSPQsfebTRvnnE/edit?tab=t.0#heading=h.7wcod1f9afpg After #67041, the raylet of the node where a consuming actor runs knows which of the objects it pulls are moves. This PR acts on that record when such an object arrives: the received copy is pinned as the object's new primary copy and the owner is told where the primary copy now lives. The producer's copy is not freed yet; that is in a future PR. # Changes 1. **Receiving a move keeps the object alive until it is pinned.** `ObjectBufferPool::WriteChunk` now returns whether the chunk it wrote sealed the object, and takes `defer_release`. With it set, the sealing chunk seals the object but keeps the plasma store reference that was taken when the object was created. The reason: the seal happens on the RPC thread, the pin happens later on the main thread, and in between a sealed copy that nobody references is just another evictable object. Holding the reference across that window is what stops the store from evicting the fresh copy before it is pinned. `ReleaseObject` drops the reference once the pin is done. 2. **`AbortCreate` skips an object sealed this way** (i.e. by move semantic method). This is because the store rejects aborting a sealed object, and the pull that owns the object is cancelled by the store's own "object added" notification, which in-turn triggerse `AbortCreate` which lands before the pin. 3. **The raylet pins the move when the store reports the object as local.** The pin happens in `NodeManager::HandleObjectLocal`. If the object has a move record, it calls `PinAndReportMovedObject` first. Only then does it call `LeaseDependencyManager::HandleObjectLocal`, which cancels the wait pull and drops the record. This order is safe for one reason. `PlasmaStore::SealObjects` invokes `add_object_callback` before Seal returns to `WriteChunk`, and that callback posts `HandleObjectLocal` to the main service. `ReceiveObjectChunk` posts its `ReleaseObject` only after `WriteChunk` returns. So the pin always runs before the release. The chunk ack in `HandlePush` is unchanged. An object without a record is handled as before. 4. **`NodeManager::PinAndReportMovedObject`.** Same steps as `HandlePinObjectIDs` for one object: skip if the owner is known dead. Also skip if fetch from plasma fails, if the object is gone or pending deletion. If everything is fine, it calls `PinObjectsAndWaitForFree` and then reports to the owner. 5. **The owner learns the new primary.** `ObjectLocationUpdate` gains a `primary_moved_to_node_id` field. `OwnershipBasedObjectDirectory::ReportObjectPrimaryMoved` sends it through the existing `UpdateObjectLocationBatch`. That batch already carries the ADDED update that `ObjectManager::HandleObjectAdded` sent for the same object, so the move report is always ordered after it. If that ADDED update is still waiting in the buffer, because a batch to the owner is in flight, the two go out as one message. On the owner, `HandleUpdateObjectLocationBatch` calls the existing `UpdateObjectPinnedAtRaylet`. From then on the consumer's node holds the primary copy. If that node dies, the object is reconstructed or reported lost, like any other primary copy. Losing the producer's node no longer loses the object. 6. `ObjectManager::DebugString` reports the number of move records, and `NodeManager::DebugString` the number of received moves pinned or not pinned. All zero on a node that never receives a move. --------- Signed-off-by: kartica.modi <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is PR 4 of a series of PRs to implement move semantics for plasma objects in core.
The complete design doc is here: https://docs.google.com/document/d/1ZJhgRmwVyKfNCR21CWf6xMcc0B6HJwSPQsfebTRvnnE/edit?tab=t.0#heading=h.7wcod1f9afpg
After #66803, an actor task's spec says which of its by-ref args it consumes (
TaskArg.is_move). This PR carries that flag to the raylet of the node where the actor runs, and makes that raylet remember, for each such arg it has to pull, that the pull is a move. Nothing reads the record yet: the next PR uses it on the receive path to pin the pulled copy as the object's new primary copy and report that to the owner.Changes
TaskSpecification::GetDependencyIsMove(). Oneboolper entry ofGetDependencies(), in the same order.The flag travels with the arg wait.
BeginArgsFetchand theAsyncWaitForArgscallback take the vector;RayletIpcClient::WaitForActorCallArgssends it in a newis_move: [bool]field ofWaitForActorCallArgsRequest, parallel toobject_ids.The raylet records it when it starts a pull.
ProcessWaitForActorCallArgs→AsyncWait→LeaseDependencyManager::StartOrUpdateWaitRequest(worker, refs, is_move). In the branch that handles a non-local arg, right before the pull, a moved arg is recorded withObjectManager::MarkMovePull. If the object is not local but a pull for it already exists (aray.getin flight, or another worker'sray.wait), the arg is still recorded and no second pull is started. An arg that is already local is neither pulled nor recorded; a later PR handles that case.StartOrUpdateWaitRequestis also used for an ordinaryray.wait; that caller passes an emptyis_movevector, so a plainray.waitnever records anything.ObjectManagerkeeps the record. It is a set of object IDs. The set is written on the main thread (MarkMovePulladds,CancelPullremoves) and will be read on the RPC threads (IsMovePull, fromReceiveObjectChunk, once per chunk, in the next PR), so it is guarded by a mutex; reads take a shared lock.An object is removed from the set when its last pull ends, not its first (there could be multiple pulls for the same object).
PullManageralready tracks which pulls still need an object and tellsCancelPullwhich objects nobody needs any more; the record is erased only for those. So if two pulls want the same object (aray.getin flight plus the actor's wait, orc.remote(r, r)), ending one of them keeps the record.Tests
task_spec_test:GetDependencyIsMoveon theTestArgIsMovefixture.lease_dependency_manager_test: a moved, a plain and a local moved arg (one record, two pulls); a plainray.waitrecords nothing; a moved arg whose pull already exists from aray.getor from another worker's wait; the same moved arg passed twice starts one pull.object_manager_test: the record is idempotent, survives cancelling one of two pulls, and is dropped with the last one.python/ray/tests/test_consume_once.py(32 passed), and a two-node script covering a cross-node consume with a plain arg,c.remote(r, r), a same-node consume, an ownerray.wait(fetch_local=True)before the consume, and a plainray.waitinside an actor.