diff options
author | Dwight <dmerriman@gmail.com> | 2009-02-04 13:53:08 -0500 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2009-02-04 13:53:08 -0500 |
commit | 1290733ed9428de5b707b4f5607222c6ba0b04c3 (patch) | |
tree | c193f736843b85c3e411e4bec4e689bf21432d77 /db/storage.cpp | |
parent | e2e9efa98a7aa107713b05c71a4d324da7a60282 (diff) | |
download | mongo-1290733ed9428de5b707b4f5607222c6ba0b04c3.tar.gz |
some debug logging
Diffstat (limited to 'db/storage.cpp')
-rw-r--r-- | db/storage.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/db/storage.cpp b/db/storage.cpp index 219f5c471a0..6d1acbcb948 100644 --- a/db/storage.cpp +++ b/db/storage.cpp @@ -24,8 +24,11 @@ RecCache BasicCached_RecStore::rc(BucketSize); // Currently only called on program exit. void recCacheCloseAll() {
#if defined(_RECSTORE)
+ assert( dbMutexInfo.isLocked() );
+ (cout << "TEMP: writing dirty pages...\n").flush();
BasicCached_RecStore::rc.writeDirty( true );
RecCache::tempStore.flush();
+ (cout << "TEMP: write dirty done\n").flush();
#endif
}
@@ -68,8 +71,11 @@ void BasicRecStore::init(const char *fn, unsigned recsize) /* -------------------------------------------------------- */
+int ndirtywritten;
+
inline void RecCache::writeIfDirty(Node *n) {
if( n->dirty ) {
+ ndirtywritten++;
n->dirty = false;
tempStore.update(fileOfs(n->loc), n->data, recsize);
}
@@ -78,11 +84,13 @@ inline void RecCache::writeIfDirty(Node *n) { /* note that this is written in order, as much as possible, given that dirtyl is of type set. */
void RecCache::writeDirty( bool rawLog ) {
try {
+ ndirtywritten=0;
for( set<DiskLoc>::iterator i = dirtyl.begin(); i != dirtyl.end(); i++ ) {
map<DiskLoc, Node*>::iterator j = m.find(*i);
if( j != m.end() )
writeIfDirty(j->second);
}
+ out() << "TEMP: ndirtywritten: " << ndirtywritten << endl;
}
catch(...) {
const char *message = "Problem: bad() in RecCache::writeDirty, file io error\n"; |