Skip to content

Commit

Permalink
dur thread sometimes falls back to a writelock, in that case don't tr…
Browse files Browse the repository at this point in the history
…y to get writelock if fsync + locked
  • Loading branch information
erh committed Feb 3, 2012
1 parent 9848a9c commit d2cb8ea
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/mongo/db/dur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ using namespace mongoutils;

namespace mongo {

extern bool lockedForWriting;

namespace dur {

void PREPLOGBUFFER(JSectHeader& outParm);
Expand Down Expand Up @@ -701,6 +703,11 @@ namespace mongo {
}
}

if ( lockedForWriting ) {
warning() << "group commit delayed beacuse of fsync + lock" << endl;
return;
}

// starvation on read locks could occur. so if read lock acquisition is slow, try to get a
// write lock instead. otherwise journaling could be delayed too long (too much data will
// not accumulate though, as commitIfNeeded logic will have executed in the meantime if there
Expand Down

0 comments on commit d2cb8ea

Please sign in to comment.