Skip to content

Commit

Permalink
when not using journalling, make sure to set if something has written…
Browse files Browse the repository at this point in the history
… to not throw PageFaultException post write SERVER-4703
  • Loading branch information
erh committed Jan 17, 2012
1 parent 6435da7 commit 6ebc582
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/mongo/db/dur.cpp
Expand Up @@ -166,10 +166,19 @@ namespace mongo {
}
}

void* NonDurableImpl::writingPtr(void *x, unsigned len) {
cc().writeHappened();
return x;
}

void NonDurableImpl::setNoJournal(void *dst, void *src, unsigned len) {
memcpy(dst, src, len);
}

void NonDurableImpl::declareWriteIntent(void *, unsigned) {
cc().writeHappened();
}

void DurableImpl::setNoJournal(void *dst, void *src, unsigned len) {
// we are at least read locked, so we need not worry about REMAPPRIVATEVIEW herein.
DEV d.dbMutex.assertAtLeastReadLocked();
Expand Down
4 changes: 2 additions & 2 deletions src/mongo/db/dur.h
Expand Up @@ -172,10 +172,10 @@ namespace mongo {
}; // class DurableInterface

class NonDurableImpl : public DurableInterface {
void* writingPtr(void *x, unsigned len) { return x; }
void* writingPtr(void *x, unsigned len);
void* writingAtOffset(void *buf, unsigned ofs, unsigned len) { return buf; }
void* writingRangesAtOffsets(void *buf, const vector< pair< long long, unsigned > > &ranges) { return buf; }
void declareWriteIntent(void *, unsigned) { }
void declareWriteIntent(void *, unsigned);
void createdFile(string filename, unsigned long long len) { }
bool awaitCommit() { return false; }
bool commitNow() { return false; }
Expand Down

0 comments on commit 6ebc582

Please sign in to comment.