[
https://issues.apache.org/jira/browse/RATIS-253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16652997#comment-16652997
]
Tsz Wo Nicholas Sze commented on RATIS-253:
-------------------------------------------
The formula is to calculate the LogEntryProto size after stateMachineData is
removed so that we may implement as below. TestRestartRaftPeer can pass with
it.
{code}
static long getEntrySize(LogEntryProto entry) {
final int serialized =
ProtoUtils.removeStateMachineData(entry).getSerializedSize();
return serialized + CodedOutputStream.computeUInt32SizeNoTag(serialized) +
4;
}
{code}
However, the above method may unnecessarily copy data. Since we are going to
refactor LogEntryProto (RATIS-353), let use it as a workaround. We will
improve it in RATIS-353 or its subtasks.
> Segmented Raft log rolls over segment frequently
> ------------------------------------------------
>
> Key: RATIS-253
> URL: https://issues.apache.org/jira/browse/RATIS-253
> Project: Ratis
> Issue Type: Bug
> Components: server
> Affects Versions: 0.2.0
> Reporter: Mukul Kumar Singh
> Assignee: Rajeshbabu Chintaguntla
> Priority: Major
> Labels: ozone
> Fix For: 0.3.0
>
> Attachments: RATIS-253.patch
>
>
> With statemachine implementation which abstract out the state machine data
> from the append entries, frequent log rollovers can be observed.
> Looking into the code, this seems to be because of 2 reasons.
> a) LogSegment#append, updates the total size. However the size which needs to
> be considered should not include the statemachine data.
> b) Also SegmentRaftLog#isSegmentFull also considers the total proto object.
> Here too, only the entry to be written to the log should be considered.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)