Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92001

GetKeyReadConcernMajorityNotAvailableYetSingleRequest is racy

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Service Arch
    • Fully Compatible
    • ALL
    • Workload Scheduling 2024-07-08, Workload Scheduling 2024-07-22
    • 200

      The test tries to wait for the periodic thread to hit failpoint when calling refresh and then advance the clock. However, this only works when the periodic thread is already waiting when the test thread advances the clock. If the mock clock was advanced first, then the periodic thread will end up waiting for a higher time.

      Example bad sequence:

      Mock clock _doPeriodicRefresh Main Test thread stdx thread
      2001 hit keys not found    
        waitFor 2201    
          failpoint set  
            getKeysForValid
          wait fpTimes 1  
        woke up by stdx getKeys    
        fpTimes = 1    
          fpWait done, adv 400  
      2401      
        waitFor 2401 + 400 = 2801    

      To repro, add a sleep (around 200ms) here

      Same issue also exist in GetKeyReadConcernMajorityNotAvailableYetMultipleRequests

      Notes:
      Mock clock is initialized at 1, and advanced twice during setup of the fixture.

            Assignee:
            george.wangensteen@mongodb.com George Wangensteen
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: