diff options
author | Eliot Horowitz <eliot@10gen.com> | 2011-07-16 13:26:37 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2011-07-16 13:28:00 -0400 |
commit | 65e14132a54705a5ac6c3098e868b815ef76e81b (patch) | |
tree | b9856c7373acb18bead022f02e03112cc47cfff1 /s/d_migrate.cpp | |
parent | d3de3070eff732369d760b1ff6721641103d41f9 (diff) | |
download | mongo-65e14132a54705a5ac6c3098e868b815ef76e81b.tar.gz |
better logging for moveChunk commit
Diffstat (limited to 's/d_migrate.cpp')
-rw-r--r-- | s/d_migrate.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/s/d_migrate.cpp b/s/d_migrate.cpp index eab1f823219..4a3789da2a5 100644 --- a/s/d_migrate.cpp +++ b/s/d_migrate.cpp @@ -1363,23 +1363,25 @@ namespace mongo { if ( res["size"].number() > 0 && apply( res , &lastOpApplied ) ) continue; - if ( state == COMMIT_START && flushPendingWrites( lastOpApplied ) ) - break; - + if ( state == ABORT ) { + timing.note( "aborted" ); + return; + } + + if ( state == COMMIT_START ) { + if ( flushPendingWrites( lastOpApplied ) ) + break; + + if ( timeWaitingForCommit.seconds() > 86400 ) { + state = FAIL; + errmsg = "timed out waiting for commit"; + return; + } + } + sleepmillis( 10 ); } - if ( state == ABORT ) { - timing.note( "aborted" ); - return; - } - - if ( timeWaitingForCommit.seconds() > 86400 ) { - state = FAIL; - errmsg = "timed out waiting for commit"; - return; - } - timing.done(5); } @@ -1472,10 +1474,11 @@ namespace mongo { bool flushPendingWrites( const ReplTime& lastOpApplied ) { if ( ! opReplicatedEnough( lastOpApplied ) ) { - warning() << "migrate commit attempt timed out contacting " << slaveCount - << " slaves for '" << ns << "' " << min << " -> " << max << migrateLog; + OCCASIONALLY warning() << "migrate commit waiting for " << slaveCount + << " slaves for '" << ns << "' " << min << " -> " << max << migrateLog; return false; } + log() << "migrate commit succeeded flushing to secondaries for '" << ns << "' " << min << " -> " << max << migrateLog; { |