summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-09-22 13:33:55 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2017-09-22 19:30:55 -0400
commit4fa949bc7c9b50a8043b76b342ab5e6b172c8af9 (patch)
tree1850ed5b5fa17b02a5d2a44b78ccdd2bdeab2e98
parent8e8b048ebf6ec989eb3a54e45cf6cb5892442748 (diff)
downloadmongo-4fa949bc7c9b50a8043b76b342ab5e6b172c8af9.tar.gz
SERVER-31195 Remove inactive test case from session_test.cpp
Given the semantics of WT to eagerly throw WCE for concurrent writes instead of waiting until commit time, this test cannot be implemented so I am removing it.
-rw-r--r--src/mongo/db/session_test.cpp45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/mongo/db/session_test.cpp b/src/mongo/db/session_test.cpp
index 3c3560c19da..df163a97d7b 100644
--- a/src/mongo/db/session_test.cpp
+++ b/src/mongo/db/session_test.cpp
@@ -317,51 +317,6 @@ TEST_F(SessionTest, WriteOpCompletedOnPrimaryForInvalidatedTransactionThrows) {
ErrorCodes::ConflictingOperationInProgress);
}
-// TODO: These tests require the storage engine used for testing to support document-level
-// concurrency control
-#if (0)
-TEST_F(SessionTest, WriteOpCompletedOnPrimaryCommitIgnoresOldTransaction) {
- const auto sessionId = makeLogicalSessionIdForTest();
- Session session(sessionId);
- session.refreshFromStorageIfNeeded(opCtx());
-
- const TxnNumber txnNum = 100;
- session.beginTxn(opCtx(), txnNum);
-
- AutoGetCollection autoColl(opCtx(), kNss, MODE_IX);
- WriteUnitOfWork wuow(opCtx());
-
- {
- const auto opTime = logOp(opCtx(), kNss, sessionId, txnNum, 0);
- session.onWriteOpCompletedOnPrimary(opCtx(), txnNum, {0}, opTime.getTimestamp());
- }
-
- // Mimics a different thread starting a newer transaction on the same session
- const TxnNumber newTxnNum = 200;
-
- stdx::async(stdx::launch::async, [&sessionId, &session, newTxnNum] {
- Client::initThreadIfNotAlready();
- auto sideOpCtx = Client::getCurrent()->makeOperationContext();
- AutoGetCollection autoColl(sideOpCtx.get(), kNss, MODE_IX);
- WriteUnitOfWork wuow(sideOpCtx.get());
- const auto opTime = logOp(sideOpCtx.get(), kNss, sessionId, newTxnNum, 1000);
- session.onWriteOpCompletedOnPrimary(
- sideOpCtx.get(), newTxnNum, {1000}, opTime.getTimestamp());
- wuow.commit();
- }).get();
-
- wuow.commit();
-
- // The newer transaction must win
- ASSERT(!session.checkStatementExecuted(opCtx(), newTxnNum, 0));
- ASSERT(session.checkStatementExecuted(opCtx(), newTxnNum, 1000));
-
- ASSERT_THROWS_CODE(session.checkStatementExecuted(opCtx(), txnNum, 0),
- AssertionException,
- ErrorCodes::ConflictingOperationInProgress);
-}
-#endif
-
TEST_F(SessionTest, WriteOpCompletedOnPrimaryCommitIgnoresInvalidation) {
const auto sessionId = makeLogicalSessionIdForTest();
Session session(sessionId);