summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/catalog/capped_utils.cpp2
-rw-r--r--src/mongo/db/catalog/local_oplog_info.cpp9
-rw-r--r--src/mongo/db/catalog/local_oplog_info.h15
-rw-r--r--src/mongo/db/catalog/rename_collection.cpp2
-rw-r--r--src/mongo/db/catalog_raii.cpp2
-rw-r--r--src/mongo/db/catalog_raii.h4
-rw-r--r--src/mongo/db/exec/upsert_stage.cpp2
-rw-r--r--src/mongo/db/index_build_entry_helpers.cpp2
-rw-r--r--src/mongo/db/repl/tenant_migration_donor_service.cpp3
-rw-r--r--src/mongo/db/transaction_participant.cpp2
10 files changed, 19 insertions, 24 deletions
diff --git a/src/mongo/db/catalog/capped_utils.cpp b/src/mongo/db/catalog/capped_utils.cpp
index 3b9ea7425bb..ba86a56e539 100644
--- a/src/mongo/db/catalog/capped_utils.cpp
+++ b/src/mongo/db/catalog/capped_utils.cpp
@@ -237,7 +237,7 @@ void cloneCollectionAsCapped(OperationContext* opCtx,
// Because of that, we acquire an optime for the insert now to ensure that the insert
// oplog entry gets logged before any delete oplog entries.
if (!isOplogDisabledForCappedCollection) {
- auto oplogInfo = repl::LocalOplogInfo::get(opCtx);
+ auto oplogInfo = LocalOplogInfo::get(opCtx);
auto oplogSlots = oplogInfo->getNextOpTimes(opCtx, /*batchSize=*/1);
insertStmt.oplogSlot = oplogSlots.front();
}
diff --git a/src/mongo/db/catalog/local_oplog_info.cpp b/src/mongo/db/catalog/local_oplog_info.cpp
index 5cf5c3b0b72..d7e51eb2892 100644
--- a/src/mongo/db/catalog/local_oplog_info.cpp
+++ b/src/mongo/db/catalog/local_oplog_info.cpp
@@ -31,6 +31,7 @@
#include "mongo/db/catalog/local_oplog_info.h"
+#include "mongo/db/repl/oplog.h"
#include "mongo/db/repl/replication_coordinator.h"
#include "mongo/db/storage/flow_control.h"
#include "mongo/db/storage/record_store.h"
@@ -39,7 +40,6 @@
#include "mongo/util/assert_util.h"
namespace mongo {
-namespace repl {
namespace {
const auto localOplogInfo = ServiceContext::declareDecoration<LocalOplogInfo>();
@@ -79,11 +79,11 @@ void LocalOplogInfo::setNewTimestamp(ServiceContext* service, const Timestamp& n
}
std::vector<OplogSlot> LocalOplogInfo::getNextOpTimes(OperationContext* opCtx, std::size_t count) {
- auto replCoord = ReplicationCoordinator::get(opCtx);
- long long term = OpTime::kUninitializedTerm;
+ auto replCoord = repl::ReplicationCoordinator::get(opCtx);
+ long long term = repl::OpTime::kUninitializedTerm;
// Fetch term out of the newOpMutex.
- if (replCoord->getReplicationMode() == ReplicationCoordinator::modeReplSet) {
+ if (replCoord->getReplicationMode() == repl::ReplicationCoordinator::modeReplSet) {
// Current term. If we're not a replset of pv=1, it remains kOldProtocolVersionTerm.
term = replCoord->getTerm();
}
@@ -125,5 +125,4 @@ std::vector<OplogSlot> LocalOplogInfo::getNextOpTimes(OperationContext* opCtx, s
return oplogSlots;
}
-} // namespace repl
} // namespace mongo
diff --git a/src/mongo/db/catalog/local_oplog_info.h b/src/mongo/db/catalog/local_oplog_info.h
index 4d96fb0e507..438d531d2bd 100644
--- a/src/mongo/db/catalog/local_oplog_info.h
+++ b/src/mongo/db/catalog/local_oplog_info.h
@@ -32,16 +32,14 @@
#include <cstddef>
#include <vector>
-#include <mongo/bson/timestamp.h>
-#include <mongo/db/catalog/collection.h>
-#include <mongo/db/namespace_string.h>
-#include <mongo/db/operation_context.h>
-#include <mongo/db/repl/oplog.h>
-#include <mongo/db/service_context.h>
-#include <mongo/stdx/mutex.h>
+#include "mongo/bson/timestamp.h"
+#include "mongo/db/catalog/collection.h"
+#include "mongo/db/namespace_string.h"
+#include "mongo/db/operation_context.h"
+#include "mongo/db/service_context.h"
+#include "mongo/stdx/mutex.h"
namespace mongo {
-namespace repl {
/**
* This structure contains per-service-context state related to the oplog.
@@ -85,5 +83,4 @@ private:
mutable Mutex _newOpMutex = MONGO_MAKE_LATCH("LocaloplogInfo::_newOpMutex");
};
-} // namespace repl
} // namespace mongo
diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp
index 254264fedfe..4442df84970 100644
--- a/src/mongo/db/catalog/rename_collection.cpp
+++ b/src/mongo/db/catalog/rename_collection.cpp
@@ -688,7 +688,7 @@ Status renameBetweenDBs(OperationContext* opCtx,
WriteUnitOfWork wunit(opCtx);
if (!isOplogDisabledForTmpColl) {
- auto oplogInfo = repl::LocalOplogInfo::get(opCtx);
+ auto oplogInfo = LocalOplogInfo::get(opCtx);
auto slots = oplogInfo->getNextOpTimes(opCtx, stmts.size());
for (std::size_t i = 0; i < stmts.size(); ++i) {
stmts[i].oplogSlot = slots[i];
diff --git a/src/mongo/db/catalog_raii.cpp b/src/mongo/db/catalog_raii.cpp
index 514feb946bb..b7486200e80 100644
--- a/src/mongo/db/catalog_raii.cpp
+++ b/src/mongo/db/catalog_raii.cpp
@@ -460,7 +460,7 @@ AutoGetOplog::AutoGetOplog(OperationContext* opCtx, OplogAccessMode mode, Date_t
_globalLock.emplace(opCtx, lockMode, deadline, Lock::InterruptBehavior::kThrow);
}
- _oplogInfo = repl::LocalOplogInfo::get(opCtx);
+ _oplogInfo = LocalOplogInfo::get(opCtx);
_oplog = &_oplogInfo->getCollection();
}
diff --git a/src/mongo/db/catalog_raii.h b/src/mongo/db/catalog_raii.h
index be5f8229916..3e742083d21 100644
--- a/src/mongo/db/catalog_raii.h
+++ b/src/mongo/db/catalog_raii.h
@@ -444,7 +444,7 @@ public:
/**
* Return a pointer to the per-service-context LocalOplogInfo.
*/
- repl::LocalOplogInfo* getOplogInfo() const {
+ LocalOplogInfo* getOplogInfo() const {
return _oplogInfo;
}
@@ -461,7 +461,7 @@ private:
boost::optional<Lock::GlobalLock> _globalLock;
boost::optional<Lock::DBLock> _dbWriteLock;
boost::optional<Lock::CollectionLock> _collWriteLock;
- repl::LocalOplogInfo* _oplogInfo;
+ LocalOplogInfo* _oplogInfo;
const CollectionPtr* _oplog;
};
diff --git a/src/mongo/db/exec/upsert_stage.cpp b/src/mongo/db/exec/upsert_stage.cpp
index 6bcb651c330..949dc975d82 100644
--- a/src/mongo/db/exec/upsert_stage.cpp
+++ b/src/mongo/db/exec/upsert_stage.cpp
@@ -155,7 +155,7 @@ void UpsertStage::_performInsert(BSONObj newDocument) {
auto replCoord = repl::ReplicationCoordinator::get(opCtx());
if (collection()->isCapped() &&
!replCoord->isOplogDisabledFor(opCtx(), collection()->ns())) {
- auto oplogInfo = repl::LocalOplogInfo::get(opCtx());
+ auto oplogInfo = LocalOplogInfo::get(opCtx());
auto oplogSlots = oplogInfo->getNextOpTimes(opCtx(), /*batchSize=*/1);
insertStmt.oplogSlot = oplogSlots.front();
}
diff --git a/src/mongo/db/index_build_entry_helpers.cpp b/src/mongo/db/index_build_entry_helpers.cpp
index e51360a51ec..a3374a2e7b7 100644
--- a/src/mongo/db/index_build_entry_helpers.cpp
+++ b/src/mongo/db/index_build_entry_helpers.cpp
@@ -230,7 +230,7 @@ Status addIndexBuildEntry(OperationContext* opCtx, const IndexBuildEntry& indexB
// Reserve a slot in the oplog as the storage engine is allowed to insert oplog
// documents out-of-order into the oplog.
- auto oplogInfo = repl::LocalOplogInfo::get(opCtx);
+ auto oplogInfo = LocalOplogInfo::get(opCtx);
auto oplogSlot = oplogInfo->getNextOpTimes(opCtx, 1U)[0];
Status status = collection->insertDocument(
opCtx,
diff --git a/src/mongo/db/repl/tenant_migration_donor_service.cpp b/src/mongo/db/repl/tenant_migration_donor_service.cpp
index c9c60c423c2..d7b2af44930 100644
--- a/src/mongo/db/repl/tenant_migration_donor_service.cpp
+++ b/src/mongo/db/repl/tenant_migration_donor_service.cpp
@@ -496,8 +496,7 @@ ExecutorFuture<repl::OpTime> TenantMigrationDonorService::Instance::_updateState
invariant(!originalRecordId.isNull());
// Reserve an opTime for the write.
- auto oplogSlot =
- repl::LocalOplogInfo::get(opCtx)->getNextOpTimes(opCtx, 1U)[0];
+ auto oplogSlot = LocalOplogInfo::get(opCtx)->getNextOpTimes(opCtx, 1U)[0];
{
stdx::lock_guard<Latch> lg(_mutex);
diff --git a/src/mongo/db/transaction_participant.cpp b/src/mongo/db/transaction_participant.cpp
index 1593f1af651..f851a48e0a5 100644
--- a/src/mongo/db/transaction_participant.cpp
+++ b/src/mongo/db/transaction_participant.cpp
@@ -683,7 +683,7 @@ TransactionParticipant::OplogSlotReserver::OplogSlotReserver(OperationContext* o
// Begin a new WUOW and reserve a slot in the oplog.
WriteUnitOfWork wuow(opCtx);
- auto oplogInfo = repl::LocalOplogInfo::get(opCtx);
+ auto oplogInfo = LocalOplogInfo::get(opCtx);
_oplogSlots = oplogInfo->getNextOpTimes(opCtx, numSlotsToReserve);
// Release the WUOW state since this WUOW is no longer in use.