summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl
diff options
context:
space:
mode:
authorIsrael Hsu <israel.hsu@mongodb.com>2022-10-26 19:03:26 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-18 12:13:20 +0000
commit9ce81dcabd0fd0930c8a44df47551285124ba4eb (patch)
tree0edaa1e57ae3029fcadeced2c249901b91aa3317 /src/mongo/db/repl
parent4cfd9b936b68622274e39100b7859ea8eb089ad8 (diff)
downloadmongo-9ce81dcabd0fd0930c8a44df47551285124ba4eb.tar.gz
SERVER-69237 Make preImage doc available to CollectionUpdateArgs
Diffstat (limited to 'src/mongo/db/repl')
-rw-r--r--src/mongo/db/repl/storage_timestamp_test.cpp12
-rw-r--r--src/mongo/db/repl/tenant_migration_donor_service.cpp2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/repl/storage_timestamp_test.cpp b/src/mongo/db/repl/storage_timestamp_test.cpp
index df33d614242..9accf4a37b8 100644
--- a/src/mongo/db/repl/storage_timestamp_test.cpp
+++ b/src/mongo/db/repl/storage_timestamp_test.cpp
@@ -3184,14 +3184,14 @@ TEST_F(RetryableFindAndModifyTest, RetryableFindAndModifyUpdate) {
"storeFindAndModifyImagesInSideCollection", true);
AutoGetCollection autoColl(_opCtx, nss, LockMode::MODE_X);
CollectionWriter collection(_opCtx, autoColl);
+ const auto criteria = BSON("_id" << 0);
const auto newObj = BSON("_id" << 0 << "a" << 1 << "b" << 1);
- CollectionUpdateArgs args;
+ CollectionUpdateArgs args{oldObj};
+ args.criteria = criteria;
args.stmtIds = {1};
- args.preImageDoc = oldObj;
args.updatedDoc = newObj;
args.storeDocOption = CollectionUpdateArgs::StoreDocOption::PreImage;
args.update = BSON("$set" << BSON("b" << 1));
- args.criteria = BSON("_id" << 0);
args.retryableWrite = true;
{
@@ -3242,14 +3242,14 @@ TEST_F(RetryableFindAndModifyTest, RetryableFindAndModifyUpdateWithDamages) {
ASSERT_EQUALS(mmb::Document::kInPlaceEnabled, doc.getCurrentInPlaceMode());
AutoGetCollection autoColl(_opCtx, nss, LockMode::MODE_X);
CollectionWriter collection(_opCtx, autoColl);
+ const auto criteria = BSON("_id" << 0);
const auto newObj = BSON("_id" << 0 << "a" << 0);
- CollectionUpdateArgs args;
+ CollectionUpdateArgs args{oldObj};
+ args.criteria = criteria;
args.stmtIds = {1};
- args.preImageDoc = oldObj;
args.updatedDoc = newObj;
args.storeDocOption = CollectionUpdateArgs::StoreDocOption::PreImage;
args.update = BSON("$set" << BSON("a" << 0));
- args.criteria = BSON("_id" << 0);
args.retryableWrite = true;
{
diff --git a/src/mongo/db/repl/tenant_migration_donor_service.cpp b/src/mongo/db/repl/tenant_migration_donor_service.cpp
index 0f8f8459535..3a4505280a3 100644
--- a/src/mongo/db/repl/tenant_migration_donor_service.cpp
+++ b/src/mongo/db/repl/tenant_migration_donor_service.cpp
@@ -652,7 +652,7 @@ ExecutorFuture<repl::OpTime> TenantMigrationDonorService::Instance::_updateState
return _stateDoc.toBSON();
}();
- CollectionUpdateArgs args;
+ CollectionUpdateArgs args{originalSnapshot.value()};
args.criteria = BSON("_id" << _migrationUuid);
args.oplogSlots = {oplogSlot};
args.update = updatedStateDocBson;