summaryrefslogtreecommitdiff
path: root/src/mongo/db/session.h
Commit message (Collapse)AuthorAgeFilesLines
* SERVER-40357 expand all calls to MONGO_DISALLOW_COPYINGBilly Donahue2019-03-281-2/+2
| | | | | | | | | | | produced by: hits="$(git grep -n MONGO_DISALLOW_COPYING | cut -d: -f1 )" for f in "$hits"; do sed -i.orig ' s/^\( *\)MONGO_DISALLOW_COPYING(\(.*\));/\1\2(const \2\&) = delete;\n\1\2\& operator=(const \2\&) = delete;/; ' $f done
* SERVER-38810 Use Session's concurrency control rules instead of internal ↵Andy Schwerin2019-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutexes in TransactionParticipant This type simplifies and clarifies concurrency control in TransactionParticipant by: (1) Removing TP's own mutexes and using the Session concurrency control rules, instead. That is, certain state is only accessible when the Session is checked out, and requires no further locking. Other state is observable either while holding the client lock or while having checked out the Session. The latter type of state is modifiable only when having checked out the session and locked the client. (2) Separating the two types of state in (1) into separate sub-structures in TransactionParticipant, to make it clear who can access what state, (3) Putting all methods formerly on TransactionParticipant onto new member classes, TransactionParticipant::Participant and TransactionParticipant::Observer. The latter can only read the observable state from (1) above, and the participant may read or modify all of the state. The two types introduced by (3) are designed to enforce proper concurrency control by limiting access of their methods to the underlying TransactionParticipant member variables. The observer type has a private o() method which its other methods are required by convention to use in order to obtain read-only access to the Observable state of the TransactionParticipant. The participant type has the o() method plus an o(WithLock) method that allows mutation of the state while holding the client lock, and a p() method which allows reading and writing of the private state with no other locks. Please see the implementation in transaction_participant.cpp for examples. It is worth noting that with this change, locking the Client is not needed often and never for long, and there is no need for separate mutexes for participant state and monitoring state.
* SERVER-39560 - remove leading blank line on all C++ filesBilly Donahue2019-02-131-1/+0
| | | | | | Remove leading comments that are just stating the filename. Move any file-level comments below the copyright banner. Remove leading blank lines.
* SERVER-38810 Simplify correct usage of locking in Session/SessionCatalog.Andy Schwerin2019-01-101-60/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces two new types for gaining access to sessions in the session catalog, based on the context of the access. It leaves a third way to access sessions, which is via OperationContextSession::get(). The new types are ObservableSession and SessionToKill. With this change, a thread may access a session in one of three ways: (1) by binding the session to an OperationContext for regular use, by instantiation of OperationContextSession or MongoDOperationContextSession, as before. (2) In the callback passed to SessionCatalog::scanSessions, in which case the callback is passed an ObservableSession that represents looking at a Session while the SessionCatalog mutex is locked and while the bound OperationContext's client mutex is held, if the session is currently checked out via methods (1) or (3). (3) By calling SessionCatalog::checkOutSessionForKill, which returns a KillableSession. This is used for cleaning a session up after it is marked for kill. This patch eliminates Session::_mutex, which is no longer required, as the SessionCatalog::_mutex and the Client provide all necessary mutual exclusion for the Session type itself.
* SERVER-38224 Allow sessions to have more than one outstanding kill requestKaloian Manassiev2018-12-121-11/+11
| | | | Also reverts commit e13e069902099d601c6cf64def9fc374082a629e (SERVER-38058 Make retryable_writes_direct_write_to_config_transactions.js expect ConflictingOperationInProgress) since it is no longer necessary.
* SERVER-37244 Make sessions killable outside of the ↵Kaloian Manassiev2018-10-311-0/+38
| | | | Session/TransactionParticipant object
* SERVER-37244 Pull the Session state management from SessionRuntimeInfo into ↵Kaloian Manassiev2018-10-301-13/+19
| | | | | | | | Session The session's check-out state is currently duplicated between SessionCatalog's internal container structure and the Session class. This change moves it all to be under Session.
* SERVER-37651 Update header files with new licenseRamon Fernandez2018-10-221-9/+11
|
* SERVER-36799 Move all transactions and retryable writes functionality from ↵Kaloian Manassiev2018-10-081-238/+7
| | | | | | | Session into TransactionParticipant This change leaves the Session class to be a plain decorable structure only used for serialization of operations on the same logical session.
* SERVER-35863 log abortTransaction oplog entry when prepared transactionsJudah Schvimer2018-09-071-0/+5
| | | | abort
* SERVER-36331 Kill running op when a transaction expiresSpencer T Brody2018-08-151-0/+20
|
* SERVER-35866 Add state field to transaction tableJudah Schvimer2018-08-121-2/+6
|
* SERVER-35900 Refactor transaction machinery out from Session classRandolph Tan2018-08-081-462/+32
|
* SERVER-35770 Running a multi-statement transaction when all WiredTiger write ↵Matthew Russotto2018-08-081-1/+3
| | | | tickets are exhausted may lead to deadlock
* SERVER-35798 preallocate prepare timestampJudah Schvimer2018-08-071-0/+31
|
* SERVER-36414 Add readConcern to slow transaction loggingjinichu2018-08-031-4/+7
|
* SERVER-35433 Remove extra lockNathan Louie2018-08-011-1/+1
|
* SERVER-35433 Fix lintWilliam Schultz2018-08-011-1/+1
|
* SERVER-35433 Log slow transactions when they finishNathan Louie2018-08-011-8/+27
|
* SERVER-35809 Refactor transaction abort.Siyuan Zhou2018-07-301-2/+16
|
* SERVER-35809 Change transaction state enum class to enum.Siyuan Zhou2018-07-301-26/+26
|
* SERVER-35598 refactor commitTransaction for prepareJudah Schvimer2018-07-271-6/+11
|
* SERVER-35174 Added readConcern and readTimestamp to CurOp's transaction ↵jinichu2018-07-251-2/+11
| | | | sub-document
* SERVER-35432 Add a method for printing out information about a slow transactionNathan Louie2018-07-251-0/+13
|
* SERVER-35378 make prepareTransaction command return the prepareTimestampPavi Vetriselvan2018-07-231-2/+2
|
* SERVER-35597 SERVER-35598 Ensure prepared transactions can be committedJudah Schvimer2018-07-201-9/+26
|
* SERVER-35173 Added autocommit value to currentOp's transaction sub-documentjinichu2018-07-051-0/+11
|
* SERVER-35729 Create explicit Session state transition tableJudah Schvimer2018-07-031-21/+83
|
* SERVER-35362 Make Session decorable and add Transaction Coordinator and ↵Esha Maharishi2018-06-261-1/+1
| | | | Participant as decorations
* SERVER-35376 added prepared state to sessionJudah Schvimer2018-06-211-2/+19
|
* SERVER-34113 Remove all support for snapshot reads outside multi-document ↵Xiangyu Yao2018-06-191-16/+0
| | | | transactions
* SERVER-35300 Added startTime field to TxnStats to store the start time of a ↵jinichu2018-06-181-0/+4
| | | | transaction
* SERVER-35376 move prepareTransaction logic to sessionJudah Schvimer2018-06-181-0/+5
|
* SERVER-35217 Do not kill associated client cursors when transaction endsTess Avitabile2018-06-081-44/+7
|
* SERVER-35492 Renamed TxnStats class to SingleTransactionStatsjinichu2018-06-081-3/+3
|
* SERVER-34824 Make prepareTransaction command write a prepare oplog entry and ↵Judah Schvimer2018-06-071-1/+21
| | | | use its optime as the prepare timestamp
* SERVER-35126 Created new struct TxnStats under SessionJinny Byun2018-06-061-1/+5
|
* SERVER-34958 Deleted unused condition variable Session::_commitcvjinichu2018-06-051-3/+0
|
* SERVER-33327 Don't update lastWriteDate field in ↵Blake Oler2018-05-291-1/+7
| | | | Session::onMigrateCompletedOnPrimary
* SERVER-34774: Maintain multikey state during multi-statement transaction.Daniel Gottlieb2018-05-161-0/+13
|
* SERVER-34811 Forbid reads and writes to the config, admin, and local ↵Tess Avitabile2018-05-081-1/+3
| | | | databases within transactions
* SERVER-34651 Squash writes for updates to config.transactions during ↵Randolph Tan2018-05-071-7/+0
| | | | secondary replication
* SERVER-34038 Make sure that commitTransaction waits for writeConcern after a ↵Matthew Russotto2018-05-031-0/+9
| | | | | | | read-only transaction. This also ensures we can obtain a local snapshot when starting a transaction, by starting the transaction before allowing the local snapshot to move forward.
* SERVER-33690 Transaction abort and commit should kill any associated client ↵James Wahlin2018-04-161-7/+55
| | | | cursors
* SERVER-33951 Abort transactions when the pending writes pass 16MB worth of ↵Matthew Russotto2018-04-131-0/+3
| | | | write data
* SERVER-33295 Periodic task to check for and kill expired transactions.Dianna Hohensee2018-04-131-0/+18
| | | | (Adding a new int server parameter 'transactionLifetimeLimitSeconds'.)
* SERVER-33548 Enable profiling for batch writes within transactionsTess Avitabile2018-04-131-0/+1
|
* SERVER-33501 Support retryable writes for commitTransaction commandSiyuan Zhou2018-04-111-1/+1
| | | | This reverts commit f205975ea89798fa1b6d91097226ae7b10ad9f3c.
* Revert "SERVER-33501 Support retryable writes for commitTransaction command"William Schultz2018-04-111-1/+1
| | | | This reverts commit 4e1fff07b0d76337232abc682fbbe13c546e5c13.
* SERVER-33501 Support retryable writes for commitTransaction commandSiyuan Zhou2018-04-101-1/+1
|