diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-08-23 08:47:18 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-08-23 08:47:18 +0200 |
commit | a3bbc293c62e68425bdf6f8e983e2bfaa97ab06e (patch) | |
tree | 835c5b2f35a8ad1b46a49680524dfe884cae1d1b /s/writeback_listener.cpp | |
parent | bf8d466302e046d534b67751d012669f43bf672a (diff) | |
parent | cbe2d992e9cd1ea66af9fa91df006106775d3073 (diff) | |
download | mongodb-a3bbc293c62e68425bdf6f8e983e2bfaa97ab06e.tar.gz |
Merge commit 'upstream/1.8.3'
Diffstat (limited to 's/writeback_listener.cpp')
-rw-r--r-- | s/writeback_listener.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/s/writeback_listener.cpp b/s/writeback_listener.cpp index 769163e..df7cc35 100644 --- a/s/writeback_listener.cpp +++ b/s/writeback_listener.cpp @@ -167,7 +167,9 @@ namespace mongo { if ( logLevel ) log(1) << debugString( m ) << endl; - if ( needVersion.isSet() && needVersion <= db->getChunkManager( ns )->getVersion() ) { + ShardChunkVersion start = db->getChunkManager( ns )->getVersion(); + + if ( needVersion.isSet() && needVersion <= start ) { // this means when the write went originally, the version was old // if we're here, it means we've already updated the config, so don't need to do again //db->getChunkManager( ns , true ); // SERVER-1349 @@ -176,7 +178,16 @@ namespace mongo { // we received a writeback object that was sent to a previous version of a shard // the actual shard may not have the object the writeback operation is for // we need to reload the chunk manager and get the new shard versions - db->getChunkManager( ns , true ); + bool good = false; + for ( int i=0; i<100; i++ ) { + if ( db->getChunkManager( ns , true )->getVersion() >= needVersion ) { + good = true; + break; + } + log() << "writeback getChunkManager didn't update?" << endl; + sleepmillis(10); + } + assert( good ); } // do request and then call getLastError |