Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

SERVER-12876: fix durability check for if we need to commit fixing co…

…mpact
  • Loading branch information...
commit b605f98c68a03fd0e65be72f9a22af4f107dee6b 1 parent 58baf15
Eliot erh authored
3  src/mongo/db/dur.cpp
@@ -270,8 +270,9 @@ namespace mongo {
270 270 return p;
271 271 }
272 272
273   - bool DurableImpl::aCommitIsNeeded() const {
  273 + bool DurableImpl::isCommitNeeded() const {
274 274 DEV commitJob._nSinceCommitIfNeededCall = 0;
  275 + unspoolWriteIntents();
275 276 return commitJob.bytes() > UncommittedBytesLimit;
276 277 }
277 278
6 src/mongo/db/dur.h
@@ -132,7 +132,7 @@ namespace mongo {
132 132 virtual bool commitIfNeeded(bool force=false) = 0;
133 133
134 134 /** @return true if time to commit but does NOT do a commit */
135   - virtual bool aCommitIsNeeded() const = 0;
  135 + virtual bool isCommitNeeded() const = 0;
136 136
137 137 /** Declare write intent for a DiskLoc. @see DiskLoc::writing() */
138 138 inline DiskLoc& writingDiskLoc(DiskLoc& d) { return *((DiskLoc*) writingPtr(&d, sizeof(d))); }
@@ -202,7 +202,7 @@ namespace mongo {
202 202 bool awaitCommit() { return false; }
203 203 bool commitNow();
204 204 bool commitIfNeeded(bool);
205   - bool aCommitIsNeeded() const { return false; }
  205 + bool isCommitNeeded() const { return false; }
206 206 void syncDataAndTruncateJournal() {}
207 207 bool isDurable() const { return false; }
208 208 };
@@ -216,7 +216,7 @@ namespace mongo {
216 216 void createdFile(const std::string& filename, unsigned long long len);
217 217 bool awaitCommit();
218 218 bool commitNow();
219   - bool aCommitIsNeeded() const;
  219 + bool isCommitNeeded() const;
220 220 bool commitIfNeeded(bool);
221 221 void syncDataAndTruncateJournal();
222 222 bool isDurable() const { return true; }
2  src/mongo/db/structure/collection_compact.cpp
@@ -168,7 +168,7 @@ namespace mongo {
168 168 // remove the old records (orphan them) periodically so our commit block doesn't get too large
169 169 bool stopping = false;
170 170 RARELY stopping = *killCurrentOp.checkForInterruptNoAssert() != 0;
171   - if( stopping || getDur().aCommitIsNeeded() ) {
  171 + if( stopping || getDur().isCommitNeeded() ) {
172 172 e->firstRecord.writing() = L;
173 173 Record *r = L.rec();
174 174 getDur().writingInt(r->prevOfs()) = DiskLoc::NullOfs;

0 comments on commit b605f98

Please sign in to comment.
Something went wrong with that request. Please try again.