Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-48356

[BP 7.0.2] MVCCPurger may stop running if doProceed check fails

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Unknown

    Description

      The issue was spotted by Srinath.

      Looking at the mvcc_purger code, I have a question.
      case <-s.purgerCh:
                  if time.Duration(time.Now().UnixNano()-lastPurgerTime) > purgerInterval {
                      purgeRatio := s.GetStats().MVCCPurgeRatio                ctx := s.newWCtx()
                      if s.Config.PurgeThreshold > 0 &&
                          purgeRatio > s.Config.PurgeThreshold &&
                          atomic.CompareAndSwapInt32(&s.isPurgerRunning, 0, 1) &&
                          doProceed(ctx)

      {                    s.logInfo(fmt.Sprintf(“mvccPurger: starting... purge_ratio %.5f”, purgeRatio))                     s.PurgePages(s.Config.PurgeLowThreshold, ctx)                     purgeRatio = s.GetStats().MVCCPurgeRatio                     s.trySMRObjects(ctx, 0)                     s.logInfo(fmt.Sprintf(“mvccPurger: finished... purge_ratio %.5f”, purgeRatio))                     atomic.StoreInt32(&s.isPurgerRunning, 0)                 }

                      s.releaseWCtx2(ctx)
                      lastPurgerTime = time.Now().UnixNano()
                  }if atomic.CompareAndSwapInt32(&s.isPurgerRunning, 0, 1)  succeeds and doProceed(ctx)  fails, we are not resetting isPurgerRunning to 0.  So, further calls to purge will not happen. 

      Attachments

        Issue Links

          Activity

            People

              saptarshi.sen Saptarshi Sen
              saptarshi.sen Saptarshi Sen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty