Skip to content

Commit

Permalink
more detailed log output on initial sync SERVER-2232
Browse files Browse the repository at this point in the history
  • Loading branch information
kchodorow committed Mar 21, 2011
1 parent e9e9202 commit 79d8885
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 0 additions & 1 deletion db/repl/rs_initialsync.cpp
Expand Up @@ -252,7 +252,6 @@ namespace mongo {
/* apply relevant portion of the oplog
*/
{
sethbmsg("initial sync initial oplog application");
isyncassert( "initial sync source must remain readable throughout our initial sync [2]", source->state().readable() );
if( ! initialSyncOplogApplication(source, /*applyGTE*/startingTS, /*minValid*/mvoptime) ) { // note we assume here that this call does not throw
log() << "replSet initial sync failed during applyoplog" << rsLog;
Expand Down
16 changes: 13 additions & 3 deletions db/repl/rs_sync.cpp
Expand Up @@ -88,6 +88,9 @@ namespace mongo {
log() << "replSet initial sync but received a first optime of " << t << " from " << hn << rsLog;
return false;
}

sethbmsg(str::stream() << "initial oplog application from " << hn << " starting at "
<< t.toStringPretty() << " to " << minValid.toStringPretty());
}
}
catch(DBException& e) {
Expand All @@ -100,6 +103,7 @@ namespace mongo {

// todo : use exhaust
OpTime ts;
time_t start = time(0);
unsigned long long n = 0;
while( 1 ) {
try {
Expand Down Expand Up @@ -132,9 +136,15 @@ namespace mongo {
}
_logOpObjRS(o); /* with repl sets we write the ops to our oplog too */
}
if( ++n % 100000 == 0 ) {
// simple progress metering
log() << "replSet initialSyncOplogApplication " << n << rsLog;

if ( ++n % 1000 == 0 ) {
time_t now = time(0);
if (now - start > 10) {
// simple progress metering
log() << "initialSyncOplogApplication applied " << n << " operations, synced to "
<< ts.toStringPretty() << rsLog;
start = now;
}
}

getDur().commitIfNeeded();
Expand Down

0 comments on commit 79d8885

Please sign in to comment.