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

Deadlock involving ViewCatalog mutex and MMAPv1 flush lock

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Component/s: MMAPv1, Querying
    • Labels:
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Reproducible via the following FSM test:

      'use strict';
      load('jstests/concurrency/fsm_workload_helpers/drop_utils.js');  // for dropCollections
       
      var $config = (function() {
       
          var data = {
              // Use the workload name as a prefix for the view name, since the workload name is assumed
              // to be unique.
              prefix: 'system_views_write'
          };
       
          var states = (function() {
       
              function init(db, collName) {
                  this.threadViewName = this.prefix + '_' + this.tid;
                  this.threadViewNS = db.getName() + '.' + this.threadViewName;
                  this.collNS1 = db[collName].getFullName();
                  this.collNS2 = db[collName].getFullName() + "_2";
              }
       
              function insert(db, collName) {
                  const pipeline = [];
                  assertAlways.writeOK(db.system.views.insert({_id: this.threadViewNS, viewOn: this.collNS1, pipeline: pipeline}));
              }
       
              function update(db, collName) {
                  assertAlways.writeOK(db.system.views.update({_id: this.threadViewNS}, {$set: {viewOn: this.collNS2}}));
              }
       
              function remove(db, collName) {
                  assertAlways.writeOK(db.system.views.remove({_id: this.threadViewNS}));
              }
       
              function read(db, collName) {
                  // This is a read on an non-existent collection, which will require ViewCatalog lookup.
                  assertAlways.commandWorked(db.runCommand({find: collName}));
              }
       
              return {init: init, insert: insert, update: update, read: read, remove: remove};
       
          })();
       
          var transitions = {
              init: {insert: 1},
              insert: {update: 0.5, read: 0.5},
              update: {remove: 0.5, read: 0.5},
              read: {remove: 0.5, read: 0.5},
              remove: {insert: 1}
          };
       
          function setup(db, collName, cluster) {
              const coll = db[collName];
              const viewsColl = db["system.views"];
              coll.drop();
              viewsColl.drop();
          }
       
          function teardown(db, collName, cluster) {
              var pattern = new RegExp('^system.views$');
              dropCollections(db, pattern);
          }
       
          return {
              threadCount: 10,
              iterations: 10000,
              data: data,
              states: states,
              transitions: transitions,
              setup: setup,
              teardown: teardown
          };
      })();
      

      Show
      Reproducible via the following FSM test: 'use strict' ; load( 'jstests/concurrency/fsm_workload_helpers/drop_utils.js' ); // for dropCollections   var $config = ( function () {   var data = { // Use the workload name as a prefix for the view name, since the workload name is assumed // to be unique. prefix: 'system_views_write' };   var states = ( function () {   function init(db, collName) { this .threadViewName = this .prefix + '_' + this .tid; this .threadViewNS = db.getName() + '.' + this .threadViewName; this .collNS1 = db[collName].getFullName(); this .collNS2 = db[collName].getFullName() + "_2" ; }   function insert(db, collName) { const pipeline = []; assertAlways.writeOK(db.system.views.insert({_id: this .threadViewNS, viewOn: this .collNS1, pipeline: pipeline})); }   function update(db, collName) { assertAlways.writeOK(db.system.views.update({_id: this .threadViewNS}, {$set: {viewOn: this .collNS2}})); }   function remove(db, collName) { assertAlways.writeOK(db.system.views.remove({_id: this .threadViewNS})); }   function read(db, collName) { // This is a read on an non-existent collection, which will require ViewCatalog lookup. assertAlways.commandWorked(db.runCommand({find: collName})); }   return {init: init, insert: insert, update: update, read: read, remove: remove};   })();   var transitions = { init: {insert: 1}, insert: {update: 0.5, read: 0.5}, update: {remove: 0.5, read: 0.5}, read: {remove: 0.5, read: 0.5}, remove: {insert: 1} };   function setup(db, collName, cluster) { const coll = db[collName]; const viewsColl = db[ "system.views" ]; coll.drop(); viewsColl.drop(); }   function teardown(db, collName, cluster) { var pattern = new RegExp( '^system.views$' ); dropCollections(db, pattern); }   return { threadCount: 10, iterations: 10000, data: data, states: states, transitions: transitions, setup: setup, teardown: teardown }; })();
    • Linked BF Score:
      5

      Description

      .

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: