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

rollback_fuzzer_clean_shutdowns suite may perform unclean shutdowns

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.5.1
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      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(); }());
    • Sprint:
      Repl 2020-08-10

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              william.schultz William Schultz (Inactive)
              Reporter:
              william.schultz William Schultz (Inactive)
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: