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

Use readConcern afterClusterTime for initsync oplog queries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.4.10, 3.5.13
    • Component/s: Replication, Storage
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.4
    • Steps To Reproduce:
      Hide

      (function() {
          'use strict';
       
          load('jstests/replsets/rslib.js');
          const basename = 'initial_sync_visibility';
       
          jsTestLog('Bring up set');
          const rst = new ReplSetTest({name: basename, nodes: 1});
          rst.startSet();
          rst.initiate();
       
          const primary = rst.getPrimary();
          const primaryDB = primary.getDB(basename);
       
          jsTestLog('Create a collection');
          assert.writeOK(primaryDB['coll'].save({_id: "visible"}));
          jsTestLog('Make sure synced');
          rst.awaitReplication();
       
          jsTestLog('Activate WT visibility failpoint and write an invisible document');
          assert.commandWorked(primaryDB.adminCommand(
              {configureFailPoint: 'WTPausePrimaryOplogDurabilityLoop', mode: 'alwaysOn'}));
          assert.writeOK(primaryDB['coll'].save({_id: "invisible"}));
       
          jsTestLog('Bring up a new node');
          const secondary = rst.add({setParameter: 'numInitialSyncAttempts=3'});
          rst.reInitiate();
          assert.eq(primary, rst.getPrimary(), 'Primary changed after reconfig');
       
          jsTestLog('Wait for new node to start cloning');
          secondary.setSlaveOk();
          const secondaryDB = secondary.getDB(basename);
          wait(function() {
              return secondaryDB.stats().collections >= 1;
          }, 'never saw new node starting to clone, was waiting for collections in: ' + basename);
       
          jsTestLog('Disable WT visibility failpoint on primary making all visible.');
          assert.commandWorked(primaryDB.adminCommand(
              {configureFailPoint: 'WTPausePrimaryOplogDurabilityLoop', mode: 'off'}));
       
          jsTestLog('Wait for both nodes to be up-to-date');
          rst.awaitSecondaryNodes();
          rst.awaitReplication();
       
          jsTestLog('Check all OK');
          rst.checkReplicatedDataHashes();
          rst.stopSet(15);
      })();
      

      Show
      (function() { 'use strict';   load('jstests/replsets/rslib.js'); const basename = 'initial_sync_visibility';   jsTestLog('Bring up set'); const rst = new ReplSetTest({name: basename, nodes: 1}); rst.startSet(); rst.initiate();   const primary = rst.getPrimary(); const primaryDB = primary.getDB(basename);   jsTestLog('Create a collection'); assert.writeOK(primaryDB['coll'].save({_id: "visible"})); jsTestLog('Make sure synced'); rst.awaitReplication();   jsTestLog('Activate WT visibility failpoint and write an invisible document'); assert.commandWorked(primaryDB.adminCommand( {configureFailPoint: 'WTPausePrimaryOplogDurabilityLoop', mode: 'alwaysOn'})); assert.writeOK(primaryDB['coll'].save({_id: "invisible"}));   jsTestLog('Bring up a new node'); const secondary = rst.add({setParameter: 'numInitialSyncAttempts=3'}); rst.reInitiate(); assert.eq(primary, rst.getPrimary(), 'Primary changed after reconfig');   jsTestLog('Wait for new node to start cloning'); secondary.setSlaveOk(); const secondaryDB = secondary.getDB(basename); wait(function() { return secondaryDB.stats().collections >= 1; }, 'never saw new node starting to clone, was waiting for collections in: ' + basename);   jsTestLog('Disable WT visibility failpoint on primary making all visible.'); assert.commandWorked(primaryDB.adminCommand( {configureFailPoint: 'WTPausePrimaryOplogDurabilityLoop', mode: 'off'}));   jsTestLog('Wait for both nodes to be up-to-date'); rst.awaitSecondaryNodes(); rst.awaitReplication();   jsTestLog('Check all OK'); rst.checkReplicatedDataHashes(); rst.stopSet(15); })();
    • Sprint:
      Storage 2017-09-11
    • Linked BF Score:
      0

      Description

      This is needed to ensure visibility of the oplog entries that are queried.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: