Skip to content

Commit ced3eb6

Browse files
committed
no one uses setNoJournal anymore so get rid of SERVER-5183
1 parent 6d9beb1 commit ced3eb6

File tree

4 files changed

+1
-47
lines changed

4 files changed

+1
-47
lines changed

src/mongo/db/dur.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -177,44 +177,11 @@ namespace mongo {
177177
return x;
178178
}
179179

180-
void NonDurableImpl::setNoJournal(void *dst, void *src, unsigned len) {
181-
memcpy(dst, src, len);
182-
}
183-
184180
void NonDurableImpl::declareWriteIntent(void *, unsigned) {
185181
cc().writeHappened();
186182
}
187183

188184
void assertLockedForCommitting();
189-
void DurableImpl::setNoJournal(void *dst, void *src, unsigned len) {
190-
// we are at least read locked, so we need not worry about REMAPPRIVATEVIEW herein.
191-
assertLockedForCommitting();
192-
193-
MemoryMappedFile::makeWritable(dst, len);
194-
195-
// we enter the RecoveryJob mutex here, so that if WRITETODATAFILES is happening we do not
196-
// conflict with it
197-
scoped_lock lk1( RecoveryJob::get()._mx );
198-
199-
// we stay in this mutex for everything to work with DurParanoid/validateSingleMapMatches
200-
//
201-
// either of these mutexes also makes setNoJournal threadsafe, which is good as we call it from a read
202-
// (not a write) lock in class SlaveTracking
203-
//
204-
scoped_lock lk( privateViews._mutex() );
205-
206-
size_t ofs;
207-
MongoMMF *f = privateViews.find_inlock(dst, ofs);
208-
assert(f);
209-
void *w = (((char *)f->view_write())+ofs);
210-
// first write it to the writable (file) view
211-
memcpy(w, src, len);
212-
if( memcmp(w, dst, len) ) {
213-
// if we get here, a copy-on-write had previously occurred. so write it to the private view too
214-
// to keep them in sync. we do this as we do not want to cause a copy on write unnecessarily.
215-
memcpy(dst, src, len);
216-
}
217-
}
218185

219186
static DurableImpl* durableImpl = new DurableImpl();
220187
static NonDurableImpl* nonDurableImpl = new NonDurableImpl();
@@ -403,7 +370,6 @@ namespace mongo {
403370

404371
assert( mmf->length() == (unsigned) mmf->length() );
405372

406-
scoped_lock lk( privateViews._mutex() ); // see setNoJournal
407373
if (memcmp(p, w, (unsigned) mmf->length()) == 0)
408374
return; // next file
409375

src/mongo/db/dur.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,6 @@ namespace mongo {
134134
return (T*) writingPtr(x, sizeof(T));
135135
}
136136

137-
/** write something that doesn't have to be journaled, as this write is "unimportant".
138-
a good example is paddingFactor.
139-
can be thought of as memcpy(dst,src,len)
140-
the dur implementation acquires a mutex in this method, so do not assume it is faster
141-
without measuring!
142-
*/
143-
virtual void setNoJournal(void *dst, void *src, unsigned len) = 0;
144-
145137
/** Commits pending changes, flushes all changes to main data
146138
files, then removes the journal.
147139
@@ -183,7 +175,6 @@ namespace mongo {
183175
bool commitNow() { return false; }
184176
bool commitIfNeeded() { return false; }
185177
bool aCommitIsNeeded() const { return false; }
186-
void setNoJournal(void *dst, void *src, unsigned len);
187178
void syncDataAndTruncateJournal() {}
188179
};
189180

@@ -197,7 +188,6 @@ namespace mongo {
197188
bool commitNow();
198189
bool aCommitIsNeeded() const;
199190
bool commitIfNeeded();
200-
void setNoJournal(void *dst, void *src, unsigned len);
201191
void syncDataAndTruncateJournal();
202192
};
203193

src/mongo/db/dur_recover.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace mongo {
4040
unsigned long long _lastDataSyncedFromLastRun;
4141
unsigned long long _lastSeqMentionedInConsoleLog;
4242
public:
43-
mongo::mutex _mx; // protects _mmfs; see setNoJournal() too
43+
mongo::mutex _mx; // protects _mmfs
4444
private:
4545
bool _recovering; // are we in recovery or WRITETODATAFILES
4646

src/mongo/db/namespace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ namespace mongo {
299299
double x = paddingFactor - 0.001;
300300
if ( x >= 1.0 ) {
301301
*getDur().writing(&paddingFactor) = x;
302-
//getDur().setNoJournal(&paddingFactor, &x, sizeof(x));
303302
}
304303
}
305304
}
@@ -316,7 +315,6 @@ namespace mongo {
316315
double x = paddingFactor + (0.001 * N);
317316
if ( x <= 2.0 ) {
318317
*getDur().writing(&paddingFactor) = x;
319-
//getDur().setNoJournal(&paddingFactor, &x, sizeof(x));
320318
}
321319
}
322320
}

0 commit comments

Comments
 (0)