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

minor_version_upgrade_replset.js should handle exceptions from isFinished() while primary is stepping down

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Replication
    • Labels:
      None
    • Replication
    • Fully Compatible
    • ALL
    • Repl 2017-02-13, Repl 2017-03-06
    • 0

      The function used to generate the insert/find workload catches and handles exceptions from the insert/find() operations. However, isFinished() also runs a find() which may throw an exception if the server is unavailable (e.g. during step-down):

      function findAndInsert(rsURL, coll) {
          var coll = new Mongo(rsURL).getCollection(coll + "");
          var count = 0;
      
          jsTest.log("Starting finds and inserts...");
      
          while (!isFinished()) {
              try {
                  coll.insert({_id: count, hello: "world"});
                  assert.eq(null, coll.getDB().getLastError());
                  assert.neq(null, coll.findOne({_id: count}));
              } catch (e) {
                  printjson(e);
              }
      
              count++;
          }
      
          jsTest.log("Finished finds and inserts...");
          return count;
      }
      
      

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            benety.goh@mongodb.com Benety Goh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: