summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2020-05-01 10:14:24 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-06-01 20:22:46 +0000
commitb60d4d234175dc60a7782628ef6e0d0b6369e7ab (patch)
treea3bb562ee0ef895226edce8f2fa0b9ba9fbd171d
parent496547c2552475059ad4b40f0c77223a8375c224 (diff)
downloadmongo-b60d4d234175dc60a7782628ef6e0d0b6369e7ab.tar.gz
SERVER-47879 Should read from primary in rollback_reconstructs_transactions_prepared_before_stable
(cherry picked from commit dff65458df1bdc15590429d11b275f8e44bb2a78)
-rw-r--r--jstests/replsets/rollback_reconstructs_transactions_prepared_before_stable.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/jstests/replsets/rollback_reconstructs_transactions_prepared_before_stable.js b/jstests/replsets/rollback_reconstructs_transactions_prepared_before_stable.js
index 525f7c3ae4c..c468cde2437 100644
--- a/jstests/replsets/rollback_reconstructs_transactions_prepared_before_stable.js
+++ b/jstests/replsets/rollback_reconstructs_transactions_prepared_before_stable.js
@@ -18,8 +18,8 @@ const rollbackTest = new RollbackTest(dbName);
let primary = rollbackTest.getPrimary();
// Create collection we're using beforehand.
-const testDB = primary.getDB(dbName);
-const testColl = testDB.getCollection(collName);
+let testDB = primary.getDB(dbName);
+let testColl = testDB.getCollection(collName);
assert.commandWorked(testDB.runCommand({create: collName}));
// Start a session on the primary.
@@ -82,6 +82,8 @@ arrayEq(testColl.find().toArray(), [{_id: 0}, {_id: 2}]);
// Get the correct primary after the topology changes.
primary = rollbackTest.getPrimary();
+testDB = primary.getDB(dbName);
+testColl = testDB.getCollection(collName);
rollbackTest.awaitReplication();
// Make sure we can successfully commit the recovered prepared transaction.