[core] Remove proto copies on object store transfers - #61093
Conversation
Signed-off-by: dayshah <dhyeyhshah@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a significant performance optimization by implementing a zero-copy path for object store transfers (Push RPC). This is achieved by using raw grpc::ByteBuffer instead of protobuf serialization for object chunks, avoiding memory copies. The changes are extensive, touching the RPC layer, object manager, and related components. A new wire protocol for raw pushes is defined, and corresponding client/server handlers are implemented.
My main feedback points are:
- The
PushManagerhas been simplified, but its rate-limiting logic has been removed. This is a significant behavioral change that could have performance implications. - There appears to be some dead code in the metrics accounting within
SendObjectChunk.
Overall, this is a great improvement for performance. The changes are well-structured to support the new zero-copy mechanism.
| if (from_disk) { | ||
| num_bytes_pushed_from_disk_ += chunk_ref->size; | ||
| } else { | ||
| num_bytes_pushed_from_plasma_ += chunk_ref->size; | ||
| } |
There was a problem hiding this comment.
This if (from_disk) block appears to be dead code. The zero-copy path via GetChunkRef is only taken for in-memory objects, for which from_disk will be false. When from_disk is true (for spilled objects), GetChunkRef returns std::nullopt, so this block is never reached. This can be simplified.
num_bytes_pushed_from_plasma_ += chunk_ref->size;|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
Signed-off-by: dayshah <dhyey2019@gmail.com>
Signed-off-by: dayshah <dhyey2019@gmail.com>
Problem
The current default object store transfer protocol comes with some major problems due to the fact the object has to be copied into and out of protobufs when sending the request and when receiving the request.
The extra memory usage from these intermediate protobufs means:
Solution