Ivan Andika created RATIS-2390:
----------------------------------

             Summary: Granular segment lock for SegmentedRaftLog
                 Key: RATIS-2390
                 URL: https://issues.apache.org/jira/browse/RATIS-2390
             Project: Ratis
          Issue Type: Improvement
            Reporter: Ivan Andika


Currently, SegmentedRaftLog uses RaftLogBase.lock for all its operations even 
those that only operates on certain segments (e.g. purge, appends). It might be 
possible to reduce contention by having a unique lock per segment.

For example, operations that need to operate on segments only need to hold read 
lock on RaftLogBase.lock and subsequently try to hold SegmentedRaftLog segment 
locks. We can implement something like writeLock(TermIndex fromIndex, TermIndex 
toIndex) and SegmentedRaftLog should only pick the segments locks for that 
range.



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

Reply via email to