[ 
https://issues.apache.org/jira/browse/RATIS-2009?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Duong updated RATIS-2009:
-------------------------
    Description: 
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}
 

 

  was:
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 request 
references count relies on `TransactionContext` to delegate, and 


> 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
>            Reporter: Duong
>            Priority: Major
>
> 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)

Reply via email to