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

ReplicaSetAwareService::onInitialDataAvailable() never called on primary with empty data files

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Replication
    • ALL
    • Hide

      In ReplicaSetAwareServiceRegistry::onInitialDataAvailable(), print out the name of each service signaled. 

      logd("onInitialDataAvailable for service {}", service->getServiceName());
      

      Run a simple 2 node replica set, the logs appear for the secondary, but not the primary.

      const rst = new ReplSetTest({nodes: 2});
      rst.startSet();
      rst.initiate();
      const primary = rst.getPrimary();
      assert.commandWorked(primary.getDB("test").myColl.insert({a: 1}));
      rst.awaitReplication();
      jsTest.log("Completed replicated insert but no log lines onInitialDataAvailable on the primary");
      
      rst.stopSet();
      
      Show
      In ReplicaSetAwareServiceRegistry:: onInitialDataAvailable() , print out the name of each service signaled.  logd( "onInitialDataAvailable for service {}" , service->getServiceName()); Run a simple 2 node replica set, the logs appear for the secondary, but not the primary. const rst = new ReplSetTest({nodes: 2}); rst.startSet(); rst.initiate(); const primary = rst.getPrimary(); assert .commandWorked(primary.getDB( "test" ).myColl.insert({a: 1})); rst.awaitReplication(); jsTest.log( "Completed replicated insert but no log lines onInitialDataAvailable on the primary" ); rst.stopSet();
    • Repl 2024-06-10, Repl 2024-06-24

      Starting up a new replica set, the "onInitialDataAvailable()" is never signaled on the primary of a fresh replica set with no previous data. This is confusing for users of the ReplicaSetAwareService API who rely on "onInitialDataAvailable()" to determine when data is consistent. 

            Assignee:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Reporter:
            haley.connelly@mongodb.com Haley Connelly
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: