diff options
author | Suganthi Mani <suganthi.mani@mongodb.com> | 2020-02-28 15:54:31 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-02 08:02:54 +0000 |
commit | 4628f264e60fd69cd09388e6fca0d3dd1b82f14c (patch) | |
tree | bca64008b3010bfb3500c2e6b4dabfb28d5d8862 /src/mongo/db/dbhelpers.h | |
parent | a5582fa42435116ab05efcabddf17219fbd573d6 (diff) | |
download | mongo-4628f264e60fd69cd09388e6fca0d3dd1b82f14c.tar.gz |
SERVER-39071 Implements commit quorum for two phase index builds.
Diffstat (limited to 'src/mongo/db/dbhelpers.h')
-rw-r--r-- | src/mongo/db/dbhelpers.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.h b/src/mongo/db/dbhelpers.h index 246130853ff..7b606768d02 100644 --- a/src/mongo/db/dbhelpers.h +++ b/src/mongo/db/dbhelpers.h @@ -123,6 +123,18 @@ struct Helpers { const BSONObj& o, bool fromMigrate = false); + /** + * Performs an upsert of 'updateMod' if we don't match the given 'filter'. + * Callers are expected to hold the collection lock. + * Note: Query yielding is turned off, so both read and writes are performed + * on the same storage snapshot. + */ + static void upsert(OperationContext* opCtx, + const std::string& ns, + const BSONObj& filter, + const BSONObj& updateMod, + bool fromMigrate = false); + // TODO: this should be somewhere else probably /* Takes object o, and returns a new object with the * same field elements but the names stripped out. |