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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            Build couchbase-server-7.0.2-6653 contains plasma commit 7ea663a with commit message:
            MB-48356 [BP]: Fix in MVCCPurgers's isPurgerRunning state check

            build-team Couchbase Build Team added a comment - Build couchbase-server-7.0.2-6653 contains plasma commit 7ea663a with commit message: MB-48356 [BP] : Fix in MVCCPurgers's isPurgerRunning state check

            Yes, i marked it resolved.

            saptarshi.sen Saptarshi Sen added a comment - Yes, i marked it resolved.

            This is a straightforward fix to correct a missed case. This does not need any extra testing.

            srinath.duvuru Srinath Duvuru added a comment - This is a straightforward fix to correct a missed case. This does not need any extra testing.

            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:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty