Uploaded image for project: 'Ratis'
  1. Ratis
  2. RATIS-2017

CheckAndEvictCache must be done in writeLock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0
    • 3.1.0
    • server
    • None

    Description

      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 was called from appendEntryImpl and safe under a writeLock().

       

      I noticed this error because there are get/put operations intervene with the EntryCache eviction during testing zero-copy:

      void clear() {
        map.values().forEach(ReferenceCountedObject::release);
        map.clear();
        size.set(0);
      } 

      Attachments

        Issue Links

          Activity

            People

              duongnguyen Duong
              duongnguyen Duong
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m