[SERVER-28915] Deadlock involving ViewCatalog mutex and MMAPv1 flush lock Created: 21/Apr/17  Updated: 06/Dec/22  Resolved: 14/Sep/18

Status: Closed
Project: Core Server
Component/s: MMAPv1, Querying
Affects Version/s: 3.4.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: James Wahlin Assignee: Backlog - Query Team (Inactive)
Resolution: Won't Fix Votes: 0
Labels: read-only-views
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
is related to SERVER-28188 Deadlock involving ViewCatalog mutex ... Closed
Assigned Teams:
Query
Operating System: ALL
Steps To Reproduce:

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
    };
})();

Participants:
Linked BF Score: 15

 Description   

.



 Comments   
Comment by Eric Milkie [ 31/May/18 ]

All of the unresolved tickets with a component of MMAPv1 will be examined after the MMAP code has been removed. Recently I've been going through and adding the component to some tickets where appropriate.

Comment by Ian Whalen (Inactive) [ 31/May/18 ]

milkie are you looking at all MMAPv1 tickets or just Storage-assigned tickets? Just want to make sure something like this is on your radar.

Generated at Thu Feb 08 04:19:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.