-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
So I was able to create a new WRITE command that got run with a read lock and did an insert without asserting. Presumably a lockType=WRITE/requiresAuth=false combo is unusual. There are a couple such commands right now, but I think they would more properly have read locks. Might be worth putting a guard in execCommand() anyway.
struct BogusCmd : public Command {
BogusCmd() : Command( "bogus" ){}
virtual bool slaveOk()
virtual LockType locktype()
{ return WRITE; }virtual bool requiresAuth()
{ return false; }virtual bool run(const char * badns, BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool)
{ log() << "mutex state: " << dbMutex.getState() << endl; BSONObj o = BSON( "a" << "b" ); theDataFileMgr.insert( "test.test", o ); return true; }} bogusCommand;