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

rollback_fuzzer_clean_shutdowns suite may perform unclean shutdowns

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Replication
    • None
    • Fully Compatible
    • ALL
    • Hide
      // To produce an unclean shutdown when one shouldn't be allowed, run this under resmoke with: --suites=rollback_fuzzer_clean_shutdowns jstests/rollback_restart.js
      (function() {
          "use strict";
      
          load("jstests/replsets/libs/rollback_test.js");
      
          TestData.rollbackShutdowns = true;
          let dbName = "test";
          let sourceCollName = "coll";
      
          let CommonOps = (node) => {
              // Insert a document that will exist on all nodes.
              assert.commandWorked(node.getDB(dbName)[sourceCollName].insert({}));
          };
      
          let RollbackOps = (node) => {
              // Delete the document on the rollback node so it will be refetched from sync source.
              assert.commandWorked(node.getDB(dbName)[sourceCollName].insert({}));
          };
      
          let rollbackTest = new RollbackTest("restart");
          CommonOps(rollbackTest.getPrimary());
          let rollbackNode = rollbackTest.transitionToRollbackOperations();
          RollbackOps(rollbackNode);
      
         // Neither of these should be allowed to shut down the node uncleanly.
          rollbackTest.restartNode(1, 9 /* SIGKILL */);
          rollbackTest.restartNode(1, 9 /* SIGKILL */);
      
          rollbackTest.transitionToSyncSourceOperationsBeforeRollback();
          rollbackTest.transitionToSyncSourceOperationsDuringRollback();
          rollbackTest.transitionToSteadyStateOperations();
          rollbackTest.stop();
      }());
      
      Show
      // To produce an unclean shutdown when one shouldn't be allowed, run this under resmoke with : --suites=rollback_fuzzer_clean_shutdowns jstests/rollback_restart.js ( function () { "use strict" ; load( "jstests/replsets/libs/rollback_test.js" ); TestData.rollbackShutdowns = true ; let dbName = "test" ; let sourceCollName = "coll" ; let CommonOps = (node) => { // Insert a document that will exist on all nodes. assert.commandWorked(node.getDB(dbName)[sourceCollName].insert({})); }; let RollbackOps = (node) => { // Delete the document on the rollback node so it will be refetched from sync source. assert.commandWorked(node.getDB(dbName)[sourceCollName].insert({})); }; let rollbackTest = new RollbackTest( "restart" ); CommonOps(rollbackTest.getPrimary()); let rollbackNode = rollbackTest.transitionToRollbackOperations(); RollbackOps(rollbackNode); // Neither of these should be allowed to shut down the node uncleanly. rollbackTest.restartNode(1, 9 /* SIGKILL */ ); rollbackTest.restartNode(1, 9 /* SIGKILL */ ); rollbackTest.transitionToSyncSourceOperationsBeforeRollback(); rollbackTest.transitionToSyncSourceOperationsDuringRollback(); rollbackTest.transitionToSteadyStateOperations(); rollbackTest.stop(); }());
    • Repl 2020-08-10

      The rollback_fuzzer_clean_shutdowns suite is supposed to only shut down nodes cleanly i.e. with a SIGTERM signal. This is ensured in the rollback test fixture by converting any signal to a SIGTERM if the TestData.allowUncleanShutdowns parameter is not set, which is the default. However, in stopMongoProgram we set the allowUncleanShutdown setting to true if the given signal is not equal to MongoRunner.EXIT_CLEAN. So, after we do an initial clean shutdown in a generated fuzzer test, subsequent shutdowns are allowed to be unclean i.e. use SIGKILL.

            Assignee:
            william.schultz@mongodb.com Will Schultz
            Reporter:
            william.schultz@mongodb.com Will Schultz
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: