summaryrefslogtreecommitdiff
path: root/src/mongo/db/transaction
diff options
context:
space:
mode:
authorShin Yee Tan <shinyee.tan@mongodb.com>2022-08-17 16:56:46 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-17 18:00:05 +0000
commit27d4e9bb36bc09d27c17edb4ecd38ea120fd6b28 (patch)
treeec83e5086b782a583cd94b7e938196f3be25314f /src/mongo/db/transaction
parent96debbaa3974a4c2cea4d79ddc4bd2765ad70351 (diff)
downloadmongo-27d4e9bb36bc09d27c17edb4ecd38ea120fd6b28.tar.gz
SERVER-68214 move session_catalog*, session*, logical_session* to mongo/db/session directory
Diffstat (limited to 'src/mongo/db/transaction')
-rw-r--r--src/mongo/db/transaction/SConscript12
-rw-r--r--src/mongo/db/transaction/internal_transactions_reap_service.cpp2
-rw-r--r--src/mongo/db/transaction/internal_transactions_reap_service_test.cpp4
-rw-r--r--src/mongo/db/transaction/session_txn_record.idl89
-rw-r--r--src/mongo/db/transaction/transaction_api.cpp6
-rw-r--r--src/mongo/db/transaction/transaction_api.h2
-rw-r--r--src/mongo/db/transaction/transaction_api_test.cpp2
-rw-r--r--src/mongo/db/transaction/transaction_participant.cpp4
-rw-r--r--src/mongo/db/transaction/transaction_participant.h8
-rw-r--r--src/mongo/db/transaction/transaction_participant_resource_yielder.cpp4
-rw-r--r--src/mongo/db/transaction/transaction_participant_retryable_writes_test.cpp2
-rw-r--r--src/mongo/db/transaction/transaction_participant_test.cpp4
12 files changed, 25 insertions, 114 deletions
diff --git a/src/mongo/db/transaction/SConscript b/src/mongo/db/transaction/SConscript
index f64da4c08cb..c4f2b197f96 100644
--- a/src/mongo/db/transaction/SConscript
+++ b/src/mongo/db/transaction/SConscript
@@ -7,7 +7,8 @@ env = env.Clone()
env.Library(
target='transaction',
source=[
- '$BUILD_DIR/mongo/db/session_catalog_mongod.cpp',
+ '$BUILD_DIR/mongo/db/session/session_catalog_mongod.cpp',
+ '$BUILD_DIR/mongo/db/session/session_txn_record.idl',
'internal_transactions_reap_service.cpp',
'retryable_writes_stats.cpp',
'server_transactions_metrics.cpp',
@@ -16,7 +17,6 @@ env.Library(
'transaction_participant.cpp',
'transaction_participant_resource_yielder.cpp',
'internal_transactions_reap_service.idl',
- 'session_txn_record.idl',
'transaction_participant.idl',
'transactions_stats.idl',
],
@@ -42,7 +42,7 @@ env.Library(
'$BUILD_DIR/mongo/db/repl/apply_ops_command_info',
'$BUILD_DIR/mongo/db/repl/repl_server_parameters',
'$BUILD_DIR/mongo/db/repl/replica_set_aware_service',
- '$BUILD_DIR/mongo/db/session_catalog',
+ '$BUILD_DIR/mongo/db/session/session_catalog',
'$BUILD_DIR/mongo/db/stats/fill_locker_info',
'$BUILD_DIR/mongo/db/stats/top',
'$BUILD_DIR/mongo/db/stats/transaction_stats',
@@ -61,15 +61,15 @@ env.Library(
],
LIBDEPS_PRIVATE=[
'$BUILD_DIR/mongo/db/auth/auth',
- '$BUILD_DIR/mongo/db/logical_session_id',
- '$BUILD_DIR/mongo/db/logical_session_id_helpers',
'$BUILD_DIR/mongo/db/operation_time_tracker',
'$BUILD_DIR/mongo/db/query/command_request_response',
'$BUILD_DIR/mongo/db/query/query_request',
'$BUILD_DIR/mongo/db/repl/repl_coordinator_interface',
'$BUILD_DIR/mongo/db/s/sharding_api_d',
'$BUILD_DIR/mongo/db/service_context',
- '$BUILD_DIR/mongo/db/session_catalog',
+ '$BUILD_DIR/mongo/db/session/logical_session_id',
+ '$BUILD_DIR/mongo/db/session/logical_session_id_helpers',
+ '$BUILD_DIR/mongo/db/session/session_catalog',
'$BUILD_DIR/mongo/db/shared_request_handling',
'$BUILD_DIR/mongo/executor/task_executor_interface',
'$BUILD_DIR/mongo/rpc/command_status',
diff --git a/src/mongo/db/transaction/internal_transactions_reap_service.cpp b/src/mongo/db/transaction/internal_transactions_reap_service.cpp
index 280ed58a66e..65d5ba95c5a 100644
--- a/src/mongo/db/transaction/internal_transactions_reap_service.cpp
+++ b/src/mongo/db/transaction/internal_transactions_reap_service.cpp
@@ -29,7 +29,7 @@
#include "mongo/db/transaction/internal_transactions_reap_service.h"
-#include "mongo/db/session_catalog_mongod.h"
+#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/transaction/internal_transactions_reap_service_gen.h"
#include "mongo/logv2/log.h"
diff --git a/src/mongo/db/transaction/internal_transactions_reap_service_test.cpp b/src/mongo/db/transaction/internal_transactions_reap_service_test.cpp
index 18c70c2d64e..751c5472545 100644
--- a/src/mongo/db/transaction/internal_transactions_reap_service_test.cpp
+++ b/src/mongo/db/transaction/internal_transactions_reap_service_test.cpp
@@ -33,10 +33,10 @@
#include "mongo/db/repl/replication_coordinator_mock.h"
#include "mongo/db/repl/storage_interface_impl.h"
#include "mongo/db/service_context_d_test_fixture.h"
-#include "mongo/db/session_catalog_mongod.h"
+#include "mongo/db/session/session_catalog_mongod.h"
+#include "mongo/db/session/session_txn_record_gen.h"
#include "mongo/db/transaction/internal_transactions_reap_service.h"
#include "mongo/db/transaction/internal_transactions_reap_service_gen.h"
-#include "mongo/db/transaction/session_txn_record_gen.h"
namespace mongo {
namespace {
diff --git a/src/mongo/db/transaction/session_txn_record.idl b/src/mongo/db/transaction/session_txn_record.idl
deleted file mode 100644
index 6970de0247d..00000000000
--- a/src/mongo/db/transaction/session_txn_record.idl
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright (C) 2018-present MongoDB, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the Server Side Public License, version 1,
-# as published by MongoDB, Inc.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# Server Side Public License for more details.
-#
-# You should have received a copy of the Server Side Public License
-# along with this program. If not, see
-# <http://www.mongodb.com/licensing/server-side-public-license>.
-#
-# As a special exception, the copyright holders give permission to link the
-# code of portions of this program with the OpenSSL library under certain
-# conditions as described in each individual source file and distribute
-# linked combinations including the program with the OpenSSL library. You
-# must comply with the Server Side Public License in all respects for
-# all of the code used other than as permitted herein. If you modify file(s)
-# with this exception, you may extend this exception to your version of the
-# file(s), but you are not obligated to do so. If you do not wish to do so,
-# delete this exception statement from your version. If you delete this
-# exception statement from all source files in the program, then also delete
-# it in the license file.
-#
-
-# Session Transaction Entry IDL File
-
-global:
- cpp_namespace: "mongo"
- cpp_includes:
- - "mongo/db/logical_session_id.h"
- - "mongo/db/repl/optime.h"
-
-imports:
- - "mongo/idl/basic_types.idl"
- - "mongo/db/logical_session_id.idl"
- - "mongo/db/repl/replication_types.idl"
-
-enums:
- DurableTxnState:
- description: "The state of the most recent durable transaction on a session"
- type: string
- values:
- kPrepared: "prepared"
- kCommitted: "committed"
- kAborted: "aborted"
- kInProgress: "inProgress"
-
-structs:
- sessionTxnRecord:
- description: "A document used for storing session transaction states."
- strict: false
- fields:
- _id:
- cpp_name: sessionId
- type: LogicalSessionId
- description: "The id of the session this transaction belongs to."
- parentLsid:
- cpp_name: parentSessionId
- type: LogicalSessionId
- description: "If this transaction is a retryable internal transaction, stores the id
- of the parent session for the session the transaction belongs to."
- optional: true
- txnNum:
- type: TxnNumber
- description: "The id representing this transaction."
- txnRetryCounter:
- description: "The last seen transaction retry counter for this transaction."
- type: TxnRetryCounter
- optional: true # Retryable writes do not have a txnRetryCounter field.
- startOpTime:
- type: optime
- description: "The optime of this transaction's first oplog entry."
- optional: true
- lastWriteOpTime:
- type: optime
- description: "The optime timestamp component of the last write on this
- transaction."
- lastWriteDate:
- type: date
- description: "Wall clock time of the last write which happened on on this
- transaction."
- state:
- type: DurableTxnState
- optional: true # Retryable writes do not have a state field.
- description: "The state of the most recent durable transaction on the session"
diff --git a/src/mongo/db/transaction/transaction_api.cpp b/src/mongo/db/transaction/transaction_api.cpp
index e44b7f1027f..38f7fb86eec 100644
--- a/src/mongo/db/transaction/transaction_api.cpp
+++ b/src/mongo/db/transaction/transaction_api.cpp
@@ -38,8 +38,6 @@
#include "mongo/db/commands.h"
#include "mongo/db/commands/txn_cmds_gen.h"
#include "mongo/db/error_labels.h"
-#include "mongo/db/internal_session_pool.h"
-#include "mongo/db/logical_session_id_helpers.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/operation_time_tracker.h"
@@ -49,7 +47,9 @@
#include "mongo/db/repl/read_concern_args.h"
#include "mongo/db/repl/repl_client_info.h"
#include "mongo/db/s/operation_sharding_state.h"
-#include "mongo/db/session_catalog.h"
+#include "mongo/db/session/internal_session_pool.h"
+#include "mongo/db/session/logical_session_id_helpers.h"
+#include "mongo/db/session/session_catalog.h"
#include "mongo/db/transaction_validation.h"
#include "mongo/db/write_concern_options.h"
#include "mongo/executor/task_executor.h"
diff --git a/src/mongo/db/transaction/transaction_api.h b/src/mongo/db/transaction/transaction_api.h
index 9a04c121eba..2e898f589c4 100644
--- a/src/mongo/db/transaction/transaction_api.h
+++ b/src/mongo/db/transaction/transaction_api.h
@@ -30,10 +30,10 @@
#pragma once
#include "mongo/db/cancelable_operation_context.h"
-#include "mongo/db/logical_session_id.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/query/find_command_gen.h"
#include "mongo/db/resource_yielder.h"
+#include "mongo/db/session/logical_session_id.h"
#include "mongo/executor/task_executor.h"
#include "mongo/rpc/write_concern_error_detail.h"
#include "mongo/s/write_ops/batched_command_request.h"
diff --git a/src/mongo/db/transaction/transaction_api_test.cpp b/src/mongo/db/transaction/transaction_api_test.cpp
index 7a2d5fb004b..c15b572b55a 100644
--- a/src/mongo/db/transaction/transaction_api_test.cpp
+++ b/src/mongo/db/transaction/transaction_api_test.cpp
@@ -34,11 +34,11 @@
#include "mongo/config.h"
#include "mongo/db/commands.h"
#include "mongo/db/error_labels.h"
-#include "mongo/db/logical_session_id_helpers.h"
#include "mongo/db/operation_context.h"
#include "mongo/db/s/operation_sharding_state.h"
#include "mongo/db/service_context.h"
#include "mongo/db/service_context_test_fixture.h"
+#include "mongo/db/session/logical_session_id_helpers.h"
#include "mongo/db/transaction/transaction_api.h"
#include "mongo/executor/network_interface_factory.h"
#include "mongo/executor/thread_pool_task_executor.h"
diff --git a/src/mongo/db/transaction/transaction_participant.cpp b/src/mongo/db/transaction/transaction_participant.cpp
index 43ade31c7fe..28c22397d5d 100644
--- a/src/mongo/db/transaction/transaction_participant.cpp
+++ b/src/mongo/db/transaction/transaction_participant.cpp
@@ -51,7 +51,6 @@
#include "mongo/db/dbhelpers.h"
#include "mongo/db/index/index_access_method.h"
#include "mongo/db/internal_transactions_feature_flag_gen.h"
-#include "mongo/db/logical_session_id.h"
#include "mongo/db/op_observer/op_observer.h"
#include "mongo/db/ops/update.h"
#include "mongo/db/ops/write_ops_retryability.h"
@@ -61,7 +60,8 @@
#include "mongo/db/repl/storage_interface.h"
#include "mongo/db/s/sharding_write_router.h"
#include "mongo/db/server_recovery.h"
-#include "mongo/db/session_catalog_mongod.h"
+#include "mongo/db/session/logical_session_id.h"
+#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/stats/fill_locker_info.h"
#include "mongo/db/storage/flow_control.h"
#include "mongo/db/transaction/retryable_writes_stats.h"
diff --git a/src/mongo/db/transaction/transaction_participant.h b/src/mongo/db/transaction/transaction_participant.h
index 79ecabef527..2ef6995dc6e 100644
--- a/src/mongo/db/transaction/transaction_participant.h
+++ b/src/mongo/db/transaction/transaction_participant.h
@@ -38,19 +38,19 @@
#include "mongo/db/commands/txn_cmds_gen.h"
#include "mongo/db/concurrency/d_concurrency.h"
#include "mongo/db/concurrency/locker.h"
-#include "mongo/db/logical_session_id.h"
#include "mongo/db/multi_key_path_tracker.h"
#include "mongo/db/ops/update_request.h"
#include "mongo/db/repl/oplog.h"
#include "mongo/db/repl/oplog_entry.h"
#include "mongo/db/repl/optime.h"
#include "mongo/db/repl/read_concern_args.h"
-#include "mongo/db/session.h"
-#include "mongo/db/session_catalog.h"
+#include "mongo/db/session/logical_session_id.h"
+#include "mongo/db/session/session.h"
+#include "mongo/db/session/session_catalog.h"
+#include "mongo/db/session/session_txn_record_gen.h"
#include "mongo/db/stats/single_transaction_stats.h"
#include "mongo/db/storage/recovery_unit.h"
#include "mongo/db/storage/storage_engine.h"
-#include "mongo/db/transaction/session_txn_record_gen.h"
#include "mongo/db/transaction/transaction_metrics_observer.h"
#include "mongo/idl/mutable_observer_registry.h"
#include "mongo/logv2/attribute_storage.h"
diff --git a/src/mongo/db/transaction/transaction_participant_resource_yielder.cpp b/src/mongo/db/transaction/transaction_participant_resource_yielder.cpp
index 5143ee239fd..4a6ae9c71a1 100644
--- a/src/mongo/db/transaction/transaction_participant_resource_yielder.cpp
+++ b/src/mongo/db/transaction/transaction_participant_resource_yielder.cpp
@@ -29,8 +29,8 @@
#include "mongo/db/transaction/transaction_participant_resource_yielder.h"
-#include "mongo/db/session_catalog.h"
-#include "mongo/db/session_catalog_mongod.h"
+#include "mongo/db/session/session_catalog.h"
+#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/transaction/transaction_participant.h"
namespace mongo {
diff --git a/src/mongo/db/transaction/transaction_participant_retryable_writes_test.cpp b/src/mongo/db/transaction/transaction_participant_retryable_writes_test.cpp
index 0b5c86ecbc9..7987d73f75f 100644
--- a/src/mongo/db/transaction/transaction_participant_retryable_writes_test.cpp
+++ b/src/mongo/db/transaction/transaction_participant_retryable_writes_test.cpp
@@ -44,7 +44,7 @@
#include "mongo/db/repl/storage_interface_impl.h"
#include "mongo/db/server_options.h"
#include "mongo/db/service_context.h"
-#include "mongo/db/session_catalog_mongod.h"
+#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/transaction/server_transactions_metrics.h"
#include "mongo/db/transaction/transaction_participant.h"
#include "mongo/idl/server_parameter_test_util.h"
diff --git a/src/mongo/db/transaction/transaction_participant_test.cpp b/src/mongo/db/transaction/transaction_participant_test.cpp
index 16c8d1ba235..2150768e863 100644
--- a/src/mongo/db/transaction/transaction_participant_test.cpp
+++ b/src/mongo/db/transaction/transaction_participant_test.cpp
@@ -42,8 +42,8 @@
#include "mongo/db/repl/storage_interface_impl.h"
#include "mongo/db/repl/storage_interface_mock.h"
#include "mongo/db/service_context.h"
-#include "mongo/db/session_catalog.h"
-#include "mongo/db/session_catalog_mongod.h"
+#include "mongo/db/session/session_catalog.h"
+#include "mongo/db/session/session_catalog_mongod.h"
#include "mongo/db/stats/fill_locker_info.h"
#include "mongo/db/transaction/server_transactions_metrics.h"
#include "mongo/db/transaction/transaction_participant.h"