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

[5.1.0 CLONE MB-25599] - Possible deadlock between dcp_nozzle and gomemcached

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 5.1.0
    • 5.0.0
    • XDCR
    • None
    • Untriaged
    • Unknown

    Description

      In gomecached, it holds lock while writing to the data channel.  If data channel is full, this goroutine will hold onto the lock.

      func (feed *UprFeed) doStreamClose(ch chan *UprEvent) \{
          feed.mu.RLock()
          for vb, stream := range feed.vbstreams \{
              uprEvent := &UprEvent\{
                  VBucket: vb,
                  VBuuid:  stream.Vbuuid,
                  Opcode:  gomemcached.UPR_STREAMEND,
              }
              ch <- uprEvent
          }
          feed.mu.RUnlock()
      }
      

      In dcp_nozzle.processData(), it could make gomemcached call that could wait for the same lock. 

                  if m.Opcode == mc.UPR_STREAMREQ \{
       
                          ...
       
                          } else if m.Status == mc.ROLLBACK \{
       
                                   ...
       
                                   dcp.startUprStream(vbno, updated_ts)
       
       

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-27050
          # Subject Branch Project Status CR V

          Activity

            People

              arunkumar Arunkumar Senthilnathan (Inactive)
              yu Yu Sui (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty