diff options
author | Craig Harris <craig.harris@10gen.com> | 2014-06-20 11:20:12 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2014-06-20 17:32:30 -0400 |
commit | 87739d45b9c974da88ca37d740c71b441249d45b (patch) | |
tree | c8aa6ea4b80e5e46526013d06af8f8eda6f9a840 /src/mongo/db/ops/update.cpp | |
parent | d7b4f787b0c2885ba80f76a54a4961a32ee1debf (diff) | |
download | mongo-87739d45b9c974da88ca37d740c71b441249d45b.tar.gz |
SERVER-14006 Experimental document-level locking for in-place updates
This commit enables experimental (and untested) document-level locking for
in-place updates, which do not modify indexed values.
It should absolutely not be used on production systems and is for
demonstration purposes only.
It runs under server parameter called useExperimentalDocLocking. In order
to enable it, run:
./mongod <other parameters> --setParameter useExperimentalDocLocking=true
Diffstat (limited to 'src/mongo/db/ops/update.cpp')
-rw-r--r-- | src/mongo/db/ops/update.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/ops/update.cpp b/src/mongo/db/ops/update.cpp index f3d21129fb3..963109b2537 100644 --- a/src/mongo/db/ops/update.cpp +++ b/src/mongo/db/ops/update.cpp @@ -56,6 +56,7 @@ namespace mongo { namespace mb = mutablebson; + namespace { const char idFieldName[] = "_id"; @@ -624,7 +625,6 @@ namespace mongo { runner->saveState(); if (inPlace && !driver->modsAffectIndices()) { - // If a set of modifiers were all no-ops, we are still 'in place', but there is // no work to do, in which case we want to consider the object unchanged. if (!damages.empty() ) { @@ -636,8 +636,12 @@ namespace mongo { newObj = oldObj; } else { - // The updates were not in place. Apply them through the file manager. + + // XXX: With experimental document-level locking, we do not hold the sufficient + // locks, so this would cause corruption. + fassert(18516, !useExperimentalDocLocking); + newObj = doc.getObject(); uassert(17419, str::stream() << "Resulting document after update is larger than " |