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

Secondary couldn't signal OplogWaiters to advance the lastCommittedOpTime in Chained replication mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 3.4.4, 3.4.19, 3.4.20
    • None
    • Replication
    • Replication
    • ALL
    • Hide

      a sharding cluster ,three config is  chaining. a->b->c

      we can easily get majorityOpTime < opTime in rs.isMaster().lastWrite of c。

       

      Show
      a sharding cluster ,three config is  chaining. a->b->c we can easily get majorityOpTime < opTime in rs.isMaster().lastWrite of c。  

    Description

      A replSet has three members, aa/bb/cc. In this situation , aa->bb->cc , aa is primary and the sync source of bb , bb is the sync source of cc . aa advances the lastCommittedOpTime , and it signal OplogWaiters , so bb can advance his lastCommittedOpTime , but sometimes cc couldn't advance its lastCommittedOpTime.
       
      The key problem here is the _localOplogCollection always is NULL for secondary.

      @oplog.cpp 
      void signalOplogWaiters() { 
      if (_localOplogCollection) { 
      _localOplogCollection->notifyCappedWaitersIfNeeded(); 
      } 
      }

      the only way to set _localOplogCollection is in function getLocalOplogCollection,and called here.

      void logOp(OperationContext* txn, 
      const char* opstr, 
      const char* ns, 
      const BSONObj& obj, 
      const BSONObj* o2, 
      bool fromMigrate) 
        
      void logOps(OperationContext* txn, 
      const char* opstr, 
      const NamespaceString& nss, 
      std::vector<BSONObj>::const_iterator begin, 
      std::vector<BSONObj>::const_iterator end, 
      bool fromMigrate)

      but for secondary ,it returned early because of oplog Disabled. 

      So because _localOplogCollection = NULL , when secondary update _lastCommittedOpTime , it cann't signal OplogWaiters.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-repl Backlog - Replication Team
              lpc lipengchong
              Votes:
              1 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: