summaryrefslogtreecommitdiff
path: root/s/writeback_listener.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-08-23 08:47:18 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-08-23 08:47:18 +0200
commita3bbc293c62e68425bdf6f8e983e2bfaa97ab06e (patch)
tree835c5b2f35a8ad1b46a49680524dfe884cae1d1b /s/writeback_listener.cpp
parentbf8d466302e046d534b67751d012669f43bf672a (diff)
parentcbe2d992e9cd1ea66af9fa91df006106775d3073 (diff)
downloadmongodb-a3bbc293c62e68425bdf6f8e983e2bfaa97ab06e.tar.gz
Merge commit 'upstream/1.8.3'
Diffstat (limited to 's/writeback_listener.cpp')
-rw-r--r--s/writeback_listener.cpp15
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