|
I am running the following in the mongo shell against current master. This opens a multi-statement transaction and then runs a collection drop outside of the transaction which blocks on the stashed transaction resources.
db.test.drop();
|
assert.writeOK(db.test.insert({}, {writeConcern: {w: "majority"}}));
|
const session = db.getMongo().startSession({})
|
session.startTransaction({readConcern: {level: "snapshot"}})
|
const sessionDB = session.getDatabase("test");
|
assert.commandWorked(sessionDB.runCommand({find: "test"}));
|
db.test.drop();
|
See the attached screenshot for the result. The graphviz output which generates this is:
digraph "mongod+lock-status" {
|
"Thread 0x7fd29e216700" -> "Lock 0x559449183b00";
|
"Lock 0x559449183b00" -> "Thread 0x7fd29e216700";
|
"Thread 0x7fd29233f700" -> "Lock 0x559449183b00";
|
"Thread 0x7fd29e216700" [label=""conn2" (Thread 0x7fd29e216700 (LWP 16109))" ]
|
"Lock 0x559449183b00" [label="Lock 0x559449183b00 (MongoDB lock)" ]
|
"Thread 0x7fd29233f700" [label=""clientcursormon" (Thread 0x7fd29233f700 (LWP 16068))" ]
|
}
|
|