summaryrefslogtreecommitdiff
path: root/src/mongo/s/transaction_router.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/transaction_router.h')
-rw-r--r--src/mongo/s/transaction_router.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/src/mongo/s/transaction_router.h b/src/mongo/s/transaction_router.h
index cf1be06dcca..a7b49c5eb12 100644
--- a/src/mongo/s/transaction_router.h
+++ b/src/mongo/s/transaction_router.h
@@ -90,9 +90,7 @@ public:
repl::ReadConcernArgs readConcernArgs;
// Only set for transactions with snapshot level read concern.
- boost::optional<LogicalTime> atClusterTimeForSnapshotReadConcern;
-
- boost::optional<LogicalTime> placementConflictTimeForNonSnapshotReadConcern;
+ boost::optional<LogicalTime> atClusterTime;
bool isInternalTransactionForRetryableWrite;
};
@@ -408,12 +406,11 @@ public:
*/
BSONObj attachTxnFieldsIfNeeded(OperationContext* opCtx,
const ShardId& shardId,
- const BSONObj& cmdObj,
- const StringData& dbName);
+ const BSONObj& cmdObj);
/**
- * Processes the transaction metadata in the response from the participant if the
- * response indicates the operation succeeded.
+ * Processes the transaction metadata in the response from the participant if the response
+ * indicates the operation succeeded.
*/
void processParticipantResponse(OperationContext* opCtx,
const ShardId& shardId,
@@ -476,11 +473,6 @@ public:
LogicalTime getSelectedAtClusterTime() const;
/**
- * Returns the placement conflict timestamp chosen for this transaction.
- */
- LogicalTime getPlacementConflictTime() const;
-
- /**
* Sets the atClusterTime for the current transaction to the latest time in the router's
* logical clock. Does nothing if the transaction does not have snapshot read concern or an
* atClusterTime has already been selected and cannot be changed.
@@ -565,13 +557,6 @@ public:
return true;
}
- /**
- * Annotate that this transaction has attempted to create database 'dbName'.
- */
- void annotateCreatedDatabase(const StringData dbName) {
- p().createdDatabases.insert(dbName.toString());
- }
-
private:
/**
* Resets the router's state. Used when the router sees a new transaction for the first
@@ -624,6 +609,14 @@ public:
BSONObj _handOffCommitToCoordinator(OperationContext* opCtx);
/**
+ * Sets the given logical time as the atClusterTime for the transaction to be the greater of
+ * the given time and the user's afterClusterTime, if one was provided.
+ */
+ void _setAtClusterTime(OperationContext* opCtx,
+ const boost::optional<LogicalTime>& afterClusterTime,
+ LogicalTime candidateTime);
+
+ /**
* Throws NoSuchTransaction if the response from abortTransaction failed with a code other
* than NoSuchTransaction. Does not check for write concern errors.
*/
@@ -723,14 +716,6 @@ public:
*/
bool _errorAllowsRetryOnStaleShardOrDb(const Status& status) const;
- /**
- * Check if the routing table has a higher timestamp than this transaction's
- * placement conflict timestamp.
- */
- void _checkForPlacementConflict(OperationContext* opCtx,
- const ShardId& shardId,
- const NamespaceString& nss);
-
TransactionRouter::PrivateState& p() {
return _tr->_p;
}
@@ -789,9 +774,7 @@ private:
// The cluster time of the timestamp all participant shards in the current transaction with
// snapshot level read concern must read from. Only set for transactions running with
// snapshot level read concern.
- boost::optional<AtClusterTime> atClusterTimeForSnapshotReadConcern;
-
- boost::optional<AtClusterTime> placementConflictTimeForNonSnapshotReadConcern;
+ boost::optional<AtClusterTime> atClusterTime;
// String representing the reason a transaction aborted. Either the string name of the error
// code that led to an implicit abort or "abort" if the client sent abortTransaction.
@@ -840,9 +823,6 @@ private:
// Track whether commit or abort have been initiated.
bool terminationInitiated{false};
-
- // Tracks databases that this transaction has attempted to create.
- std::set<std::string> createdDatabases;
} _p;
};