summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction_participant_retryable_writes_test.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-10-04 18:27:48 -0400
committerDavid Storch <david.storch@10gen.com>2018-10-23 17:18:11 -0400
commit2cdc2a96e1c8779658fe0eab459dcc38cf01c54d (patch)
tree875f55acaaba283f02895938ee4b6c764eac349a /src/mongo/db/transaction_participant_retryable_writes_test.cpp
parente7bed9bdcb376d5a06dce6228047309e8481f9cf (diff)
downloadmongo-2cdc2a96e1c8779658fe0eab459dcc38cf01c54d.tar.gz
SERVER-37443 Make catalog objects survive collection rename.
This change only applies to collection renames within the same database. Rename across databases requires copying the data, and the resulting collection will have a new UUID.
Diffstat (limited to 'src/mongo/db/transaction_participant_retryable_writes_test.cpp')
-rw-r--r--src/mongo/db/transaction_participant_retryable_writes_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/transaction_participant_retryable_writes_test.cpp b/src/mongo/db/transaction_participant_retryable_writes_test.cpp
index 56af96bf0ab..51bfc5188d2 100644
--- a/src/mongo/db/transaction_participant_retryable_writes_test.cpp
+++ b/src/mongo/db/transaction_participant_retryable_writes_test.cpp
@@ -121,6 +121,20 @@ public:
onTransactionCommitFn =
[this](boost::optional<OplogSlot> commitOplogEntryOpTime,
boost::optional<Timestamp> commitTimestamp) { transactionCommitted = true; };
+
+ repl::OpTime onDropCollection(OperationContext* opCtx,
+ const NamespaceString& collectionName,
+ OptionalCollectionUUID uuid,
+ const CollectionDropType dropType) override {
+ // If the oplog is not disabled for this namespace, then we need to reserve an op time for
+ // the drop.
+ if (!repl::ReplicationCoordinator::get(opCtx)->isOplogDisabledFor(opCtx, collectionName)) {
+ OpObserver::Times::get(opCtx).reservedOpTimes.push_back(dropOpTime);
+ }
+ return {};
+ }
+
+ const repl::OpTime dropOpTime = {Timestamp(Seconds(100), 1U), 1LL};
};
class TransactionParticipantRetryableWritesTest : public MockReplCoordServerFixture {