[ 
https://issues.apache.org/jira/browse/RATIS-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17827663#comment-17827663
 ] 

Tsz-wo Sze commented on RATIS-2028:
-----------------------------------

This require RATIS-2026.  Otherwise, in the code below, entryRef is released 
but the entry is still in the returned EntryWithData.
{code}
//SegmentedRaftLog.java
  public EntryWithData getEntryWithData(long index) throws RaftLogIOException {
    final ReferenceCountedObject<LogEntryProto> entryRef = retainLog(index);
    if (entryRef == null) {
      throw new RaftLogIOException("Log entry not found: index = " + index);
    }
    try {
      // TODO. The reference counted object should be passed to LogAppender 
RATIS-2026.
      return getEntryWithData(entryRef.get());
    } finally {
      entryRef.release();
    }
  }
{code}

> Refactor RaftLog to supply log as ReferenceCountedObject
> --------------------------------------------------------
>
>                 Key: RATIS-2028
>                 URL: https://issues.apache.org/jira/browse/RATIS-2028
>             Project: Ratis
>          Issue Type: Sub-task
>          Components: server
>            Reporter: Duong
>            Assignee: Duong
>            Priority: Major
>             Fix For: 3.1.0
>
>         Attachments: 1045_review.patch
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to