diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-06-10 18:40:08 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-06-13 16:55:01 -0400 |
commit | 3b7177d627a7a63b98b3717d982e323457267e12 (patch) | |
tree | d53b34f4b6edb6d5d50a1763ee901a59711d6d03 /src/mongo/db/s/sharding_state.h | |
parent | 8878d6e30d6542929debd989045384cd93ba50a1 (diff) | |
download | mongo-3b7177d627a7a63b98b3717d982e323457267e12.tar.gz |
SERVER-24467 Make the shard implementation of 'moveChunk' joinable
This change makes the shard implementation of the 'moveChunk' command join
a currently running migration if that migration has exactly the same
arguments as the call. This allows retriability of this command by the
balancer.
In addition, it makes the moveChunk command report success if the
specified chunk is already located on the desired destination shard.
Diffstat (limited to 'src/mongo/db/s/sharding_state.h')
-rw-r--r-- | src/mongo/db/s/sharding_state.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h index bc64ea3ec23..9ab74ea5b4a 100644 --- a/src/mongo/db/s/sharding_state.h +++ b/src/mongo/db/s/sharding_state.h @@ -215,12 +215,14 @@ public: void resetMetadata(const std::string& ns); /** - * Registers an active move chunk request with the specified arguments in order to ensure that - * there is a single active move chunk operation running per shard. + * If there are no migrations running on this shard, registers an active migration with the + * specified arguments and returns a ScopedRegisterMigration, which must be signaled by the + * caller before it goes out of scope. * - * If there aren't any migrations running on this shard, returns a ScopedRegisterMigration - * object, which will unregister it when it goes out of scope. Othwerwise returns - * ConflictingOperationInProgress. + * If there is an active migration already running on this shard and it has the exact same + * arguments, returns a ScopedRegisterMigration, which can be used to join the existing one. + * + * Othwerwise returns a ConflictingOperationInProgress error. */ StatusWith<ScopedRegisterMigration> registerMigration(const MoveChunkRequest& args); |