-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RATIS-1925. Support Zero-Copy in GrpcClientProtocolService #990
Conversation
@szetszwo can you have a look? |
The change assume
This is not necessarily true -- when the log can be fast but the Also, it needs a separated map in |
@duongkame , I suggest to do the following:
Note that (ii) and (iii) can happen in any order. |
That's the reason why we need to keep the buffer sorted by log index, so if some entry is missed because Also, Plus, as discussed as per RATIS-1979, in the case of stateMachineCachingEnabled, we may consider releasing zero-copy buffers much earlier than cache evict. The ability to release all zero copy buffers up to a certain log index seems to be crucial. |
Consider
How could 20 be released later on? |
Let's don't mix the buffer releasing logic with the Use ref count described in #990 (comment) can solve the problem. Netty uses a similar approach which works very well. |
@szetszwo My basic assumption is that hat when applied and follower indices reach a particular point, x, we can safely clean up any zero-copy for write/appendEntries up to x (0-x). I did that in the Ozone PoC and that works fine. But I'm not sure if it's correct universally for any use-cases. I think your suggestion is a better approach. Only concern is that it may lead to a more complex change as we need to pass the Closed this PR for now. Will submit a new one for the new implementation. |
What changes were proposed in this pull request?
Support Zero-Copy in GrpcClientProtocolService.
Zero copy applied to
ordered
andunordered
API.Incoming streams are managed by a component called
RaftLogZeroCopyCleaner
. It sorts the streams by associating the log index and observes the raft log cache eviction events to release the streams accordingly.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-1925
How was this patch tested?
Added integration test for zero-copy.