diff options
author | Greg Studer <greg@10gen.com> | 2013-03-07 17:38:49 -0500 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2013-08-02 11:07:32 -0400 |
commit | bae49ad621c67176cc329faba96f246597af98ea (patch) | |
tree | 64856316daf2c1416343c80e2b4a12d99621d2f3 | |
parent | 4439f7ac67ce428de77a51c23d7c99f3fac2b2c6 (diff) | |
download | mongo-bae49ad621c67176cc329faba96f246597af98ea.tar.gz |
SERVER-8899 read-lock while updating ShardChunkManager in trySetVersion()
-rw-r--r-- | src/mongo/s/d_state.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp index 95ba21ab8f9..bca04ff565a 100644 --- a/src/mongo/s/d_state.cpp +++ b/src/mongo/s/d_state.cpp @@ -275,6 +275,10 @@ namespace mongo { } { + // NOTE: This lock prevents the ns version from changing while a write operation occurs. + Lock::DBRead readLk(ns); + + // This lock prevents simultaneous metadata changes using the same map scoped_lock lk( _mutex ); // since we loaded the chunk manager unlocked, other thread may have done the same |