mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
don't use markAllWritable (a _DEBUG test feature) when dur is on
will be simpler this way. also the question would be which view to mark writable, the private or the regular view if it is on...
This commit is contained in:
parent
8091e7ca70
commit
102afdad3e
@ -79,8 +79,6 @@ namespace mongo {
|
||||
void WRITETODATAFILES() {
|
||||
dbMutex.assertAtLeastReadLocked();
|
||||
|
||||
MongoFile::markAllWritable(); // for _DEBUG. normally we don't write in a read lock
|
||||
|
||||
Timer t;
|
||||
#if defined(_EXPERIMENTAL)
|
||||
WRITETODATAFILES_Impl3();
|
||||
@ -89,8 +87,6 @@ namespace mongo {
|
||||
#endif
|
||||
stats.curr->_writeToDataFilesMicros += t.micros();
|
||||
|
||||
if (!dbMutex.isWriteLocked())
|
||||
MongoFile::unmarkAllWritable();
|
||||
|
||||
debugValidateAllMapsMatch();
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "processinfo.h"
|
||||
#include "concurrency/rwlock.h"
|
||||
#include "../db/namespace.h"
|
||||
#include "../db/cmdline.h"
|
||||
|
||||
namespace mongo {
|
||||
|
||||
@ -173,6 +174,8 @@ namespace mongo {
|
||||
|
||||
#if defined(_DEBUG)
|
||||
void MongoFile::markAllWritable() {
|
||||
if( cmdLine.dur )
|
||||
return;
|
||||
rwlock lk( mmmutex , false );
|
||||
for ( set<MongoFile*>::iterator i = mmfiles.begin(); i != mmfiles.end(); i++ ) {
|
||||
MongoFile * mmf = *i;
|
||||
@ -181,6 +184,8 @@ namespace mongo {
|
||||
}
|
||||
|
||||
void MongoFile::unmarkAllWritable() {
|
||||
if( cmdLine.dur )
|
||||
return;
|
||||
rwlock lk( mmmutex , false );
|
||||
for ( set<MongoFile*>::iterator i = mmfiles.begin(); i != mmfiles.end(); i++ ) {
|
||||
MongoFile * mmf = *i;
|
||||
|
Loading…
Reference in New Issue
Block a user