summaryrefslogtreecommitdiff
path: root/s/d_state.cpp
diff options
context:
space:
mode:
Diffstat (limited to 's/d_state.cpp')
-rw-r--r--s/d_state.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/s/d_state.cpp b/s/d_state.cpp
index 638d8c1..ef933a0 100644
--- a/s/d_state.cpp
+++ b/s/d_state.cpp
@@ -614,6 +614,15 @@ namespace mongo {
}
if ( globalVersion == 0 && ! authoritative ) {
+ // Needed b/c when the last chunk is moved off a shard, the version gets reset to zero, which
+ // should require a reload.
+ // TODO: Maybe a more elegant way of doing this
+ while ( shardingState.inCriticalMigrateSection() ) {
+ dbtemprelease r;
+ sleepmillis(2);
+ OCCASIONALLY log() << "waiting till out of critical section for version reset" << endl;
+ }
+
// need authoritative for first look
result.append( "ns" , ns );
result.appendBool( "need_authoritative" , true );