summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-06-13 17:59:18 -0400
committerEliot Horowitz <eliot@10gen.com>2011-06-13 17:59:18 -0400
commitbd1ad6d52607ff7bfd3a0b5375a38c090cb21225 (patch)
treef32a8ba0741266d3c38b5e110c9b06837b01fc3f
parent9990775e39701870c5238388aecfabda992de8e3 (diff)
downloadmongo-bd1ad6d52607ff7bfd3a0b5375a38c090cb21225.tar.gz
dont log too much when DR102 error happens
Conflicts: db/dur_commitjob.cpp
-rw-r--r--db/dur_commitjob.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/db/dur_commitjob.cpp b/db/dur_commitjob.cpp
index 2d57ffd0c96..c67f37c6bfa 100644
--- a/db/dur_commitjob.cpp
+++ b/db/dur_commitjob.cpp
@@ -200,8 +200,17 @@ namespace mongo {
log() << "debug nsincecommitifneeded:" << _nSinceCommitIfNeededCall << " bytes:" << _bytes << endl;
}
#endif
- if ( _bytes >= UncommittedBytesLimit * 3 ) {
- wassert( ! "DR102 too much data written uncommitted" );
+ if (_bytes > UncommittedBytesLimit * 3) {
+ static time_t lastComplain;
+ static unsigned nComplains;
+ // throttle logging
+ if( ++nComplains < 100 || time(0) - lastComplain >= 60 ) {
+ lastComplain = time(0);
+ log() << "replSet warning DR102 too much data written uncommitted " << _bytes/1000000.0 << "MB" << endl;
+ if( nComplains < 10 || nComplains % 10 == 0 ) {
+ wassert(!"replSet warning DR102 too much data written uncommitted");
+ }
+ }
}
}
}