TylerBrock / mongo-hacker

MongoDB Shell Enhancements for Hackers

Home Page:tylerbrock.github.io/mongo-hacker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MongoDB 4 transactions and db.getProfilingStatus()

rbro opened this issue · comments

commented

I am running into a small issue using mongo-hacker with MongoDB 4 when using transactions.

From testing, it appears to be related to the call db.getProfilingStatus(), which seems to hang if there are any open transactions.

The below is the full example I tried. Could the logic be updated so that the call doesn't hang? Thanks for your help.

Run the below in session 1:

use test;
db.createCollection('col1');
session = db.getMongo().startSession();
session.startTransaction();
session.getDatabase("test").col1.insert({"a" : "b"});

and then in session 2, run:

use test;
db.col1.find();

The find() call is hangs for me until I run "session.commitTransaction()" in session 1.