Duong created RATIS-2017:
----------------------------

             Summary: CheckAndEvictCache must be done in writeLock
                 Key: RATIS-2017
                 URL: https://issues.apache.org/jira/browse/RATIS-2017
             Project: Ratis
          Issue Type: Bug
    Affects Versions: 3.0.0
            Reporter: Duong


RATIS-1893 moved checkAndEvictCache to a separate thread. 

This opens a condition race between evictCache and normal log operations like 
get/put. 

Before RATIS-1893, checkAndEvictCache is called from appendEntryImpl and under 
a writeLock().

 

I noticed this error because there are get/put operations intervene with the 
EntryCache eviction during testing zero-copy:
{code:java}
void clear() {
  map.values().forEach(ReferenceCountedObject::release);
  map.clear();
  size.set(0);
} {code}



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

Reply via email to