[ https://issues.apache.org/jira/browse/RATIS-779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16998419#comment-16998419 ]
Mukul Kumar Singh commented on RATIS-779: ----------------------------------------- Thanks for working on this [~ljain], Let's add a comment in StateMachine.java around the lock inside which this call happens. Also, an advisory that this call along with writeStateMachineData should be as lightweight as possible. > StateMachine#truncateStateMachineData should be called during instantiation > of TruncateLog > ------------------------------------------------------------------------------------------ > > Key: RATIS-779 > URL: https://issues.apache.org/jira/browse/RATIS-779 > Project: Ratis > Issue Type: Bug > Components: server > Reporter: Lokesh Jain > Assignee: Lokesh Jain > Priority: Major > Attachments: RATIS-779.001.patch > > > Currently StateMachine#truncateStateMachineData should be called in the > constructor of TruncateLog. This makes sure that the function is called with > RaftLog write lock held. StateMachine#writeStateMachineData is also called > with RaftLog write lock held. It is important for these calls to be > synchronized. -- This message was sent by Atlassian Jira (v8.3.4#803005)