summaryrefslogtreecommitdiff
path: root/src/mongo/s/d_migrate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/d_migrate.cpp')
-rw-r--r--src/mongo/s/d_migrate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/d_migrate.cpp b/src/mongo/s/d_migrate.cpp
index fc03bdc6884..4cd98e65791 100644
--- a/src/mongo/s/d_migrate.cpp
+++ b/src/mongo/s/d_migrate.cpp
@@ -988,6 +988,12 @@ namespace mongo {
startingVersion = maxVersion;
shardingState.trySetVersion( ns , startingVersion /* will return updated */ );
+ if (startingVersion.majorVersion() == 0) {
+ // It makes no sense to migrate if our version is zero and we have no chunks, so return
+ warning() << "moveChunk cannot start migration with zero version" << endl;
+ return false;
+ }
+
log() << "moveChunk request accepted at version " << startingVersion << migrateLog;
}