diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-09-28 14:05:36 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-09-29 14:31:59 -0400 |
commit | ba3dc420fe41f9c6ba718da5eb270161374839f3 (patch) | |
tree | d8eb3e68dd62bbc2bb0b982945a62e7d892e37b4 /src/mongo/db/s/sharding_state.h | |
parent | fd94476eb6ca0207dd69662d36f93eeaaa227073 (diff) | |
download | mongo-ba3dc420fe41f9c6ba718da5eb270161374839f3.tar.gz |
SERVER-26370 Register incoming migrations on the ActiveMigrationsRegistry
In order to avoid race conditions where a shard could serve both as a
donor and recipient.
Diffstat (limited to 'src/mongo/db/s/sharding_state.h')
-rw-r--r-- | src/mongo/db/s/sharding_state.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/s/sharding_state.h b/src/mongo/db/s/sharding_state.h index 8e8f0c20074..9cf94cd4526 100644 --- a/src/mongo/db/s/sharding_state.h +++ b/src/mongo/db/s/sharding_state.h @@ -214,6 +214,15 @@ public: StatusWith<ScopedRegisterDonateChunk> registerDonateChunk(const MoveChunkRequest& args); /** + * If there are no migrations running on this shard, registers an active receive operation with + * the specified session id and returns a ScopedRegisterReceiveChunk, which will unregister it + * when it goes out of scope. + * + * Otherwise returns a ConflictingOperationInProgress error. + */ + StatusWith<ScopedRegisterReceiveChunk> registerReceiveChunk(const NamespaceString& nss); + + /** * If a migration has been previously registered through a call to registerDonateChunk returns * that namespace. Otherwise returns boost::none. * |