[
https://issues.apache.org/jira/browse/RATIS-2009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze updated RATIS-2009:
------------------------------
Component/s: gRPC
server
> ReferenceCount should work for all LogEntry types.
> --------------------------------------------------
>
> Key: RATIS-2009
> URL: https://issues.apache.org/jira/browse/RATIS-2009
> Project: Ratis
> Issue Type: Sub-task
> Components: gRPC, server
> Reporter: Duong
> Priority: Major
> Time Spent: 1h 20m
> Remaining Estimate: 0h
>
> Today, a log entry can be either StateMachineLogEntry, RaftConfiguration, or
> Metatadata.
> {code:java}
> message LogEntryProto {
> oneof LogEntryBody {
> StateMachineLogEntryProto stateMachineLogEntry = 3;
> RaftConfigurationProto configurationEntry = 4;
> MetadataProto metadataEntry = 5;
> }
> } {code}
> However, after enabling zero-copy in appendEntries, only StateMachineLog
> entries are kept with a proper reference count. This is because the request
> references count relies on `TransactionContext` to delegate, and
> TransactionContext is only available for StateMachineLog.
>
> {code:java}
> TransactionContext getTransactionContext(LogEntryProto entry, Boolean
> createNew) {
> if (!entry.hasStateMachineLogEntry()) {
> return null;
> }
> ... {code}
>
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)