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

Warning logged when incremental MR collections are unsuccessfully dropped on secondaries

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.6.5, 2.7.7
    • Affects Version/s: None
    • Component/s: MapReduce
    • Fully Compatible
    • ALL
    • Hide
      function createReplSet() {
          var replSet = new ReplSetTest({
              name: 'mapReduceReplSet',
              nodes: 2
          });
      
          replSet.startSet();
          replSet.initiate();
          replSet.awaitSecondaryNodes();
          return replSet;
      }
      
      (function testIncrementalCollectionsAreNotReplicated() {
          var replSet = createReplSet();
      
          var primaryColl = replSet.getPrimary().getDB('mapReduce').testColl;
          primaryColl.drop();
      
          // insert some dummy docs
          for (var i = 0; i < 20; i++) {
              primaryColl.insert({foo: i});
          }
      
          var mapFunction = function() {
              emit(this.foo, 1);
          };
          var reduceFunction = function() {
              return 1;
          };
      
          // these lines actually trigger the warning
          primaryColl.mapReduce(mapFunction, reduceFunction, {out: 'temp_coll'});
          replSet.awaitReplication();
      
          replSet.stopSet();
      })();
      
      Show
      function createReplSet() { var replSet = new ReplSetTest({ name: 'mapReduceReplSet', nodes: 2 }); replSet.startSet(); replSet.initiate(); replSet.awaitSecondaryNodes(); return replSet; } (function testIncrementalCollectionsAreNotReplicated() { var replSet = createReplSet(); var primaryColl = replSet.getPrimary().getDB('mapReduce').testColl; primaryColl.drop(); // insert some dummy docs for (var i = 0; i < 20; i++) { primaryColl.insert({foo: i}); } var mapFunction = function() { emit(this.foo, 1); }; var reduceFunction = function() { return 1; }; // these lines actually trigger the warning primaryColl.mapReduce(mapFunction, reduceFunction, {out: 'temp_coll'}); replSet.awaitReplication(); replSet.stopSet(); })();

      The fix for SERVER-13981 purposely allows drop commands for incremental MapReduce collections to be replicated--even though the preceding createCollection commands are not replicated. As a result, a warning like this is logged:

      [repl writer worker 1] warning: repl Failed command { drop: "tmp.mr.testColl_0_inc" } on mapReduce with status UnknownError ns not found during oplog application

      It'd be nice to prevent this (potentially confusing) warning from being triggered and logged.


      Version: 2.6.2-rc0

            Assignee:
            mathias@mongodb.com Mathias Stearn
            Reporter:
            kamran.khan Kamran K.
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: