diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2018-08-26 22:08:27 -0400 |
---|---|---|
committer | Justin Seyster <justin.seyster@mongodb.com> | 2018-08-26 22:08:27 -0400 |
commit | b93c2dcc30de6f33f871ff2b8df88ac5afafbbc1 (patch) | |
tree | 28ef7d5e310dc8453a2129df04a2959878e087fe /src/mongo/db/op_observer.h | |
parent | f66a67ac3e80f4968506cab34ac35668d65a13e6 (diff) | |
download | mongo-b93c2dcc30de6f33f871ff2b8df88ac5afafbbc1.tar.gz |
SERVER-36224 Refactor Collection::updateDocument args
Previously, Collection::updateDocument expected to get a namespace and
UUID from its OplogEntryUpdateArgs, but that is not necessary, because
the collection already knows its own namespace and UUID. This caused a
problem in DurableViewCatalogImpl::upsert(), which did not set the
UUID value in the args, leading to oplog entries without their UUID
value.
Diffstat (limited to 'src/mongo/db/op_observer.h')
-rw-r--r-- | src/mongo/db/op_observer.h | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/mongo/db/op_observer.h b/src/mongo/db/op_observer.h index ebc0590bad0..8f85478334a 100644 --- a/src/mongo/db/op_observer.h +++ b/src/mongo/db/op_observer.h @@ -52,31 +52,13 @@ class OpTime; * Holds document update information used in logging. */ struct OplogUpdateEntryArgs { - enum class StoreDocOption { None, PreImage, PostImage }; + CollectionUpdateArgs updateArgs; - // Name of the collection in which document is being updated. NamespaceString nss; + CollectionUUID uuid; - OptionalCollectionUUID uuid; - - StmtId stmtId = kUninitializedStmtId; - - // The document before modifiers were applied. - boost::optional<BSONObj> preImageDoc; - - // Fully updated document with damages (update modifiers) applied. - BSONObj updatedDoc; - - // Document containing update modifiers -- e.g. $set and $unset - BSONObj update; - - // Document containing the _id field of the doc being updated. - BSONObj criteria; - - // True if this update comes from a chunk migration. - bool fromMigrate = false; - - StoreDocOption storeDocOption = StoreDocOption::None; + OplogUpdateEntryArgs(CollectionUpdateArgs updateArgs, NamespaceString nss, CollectionUUID uuid) + : updateArgs(std::move(updateArgs)), nss(std::move(nss)), uuid(std::move(uuid)) {} }; struct TTLCollModInfo { |