diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/catalog/create_collection.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/catalog/rename_collection.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/s/session_catalog_migration_destination.cpp | 7 | ||||
-rw-r--r-- | src/mongo/db/server_recovery.h | 3 | ||||
-rw-r--r-- | src/mongo/util/processinfo.h | 7 | ||||
-rw-r--r-- | src/mongo/util/processinfo_freebsd.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_linux.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_openbsd.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_osx.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_solaris.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_unknown.cpp | 4 | ||||
-rw-r--r-- | src/mongo/util/processinfo_windows.cpp | 39 |
12 files changed, 6 insertions, 85 deletions
diff --git a/src/mongo/db/catalog/create_collection.cpp b/src/mongo/db/catalog/create_collection.cpp index 2fef0686a47..1c74a34159f 100644 --- a/src/mongo/db/catalog/create_collection.cpp +++ b/src/mongo/db/catalog/create_collection.cpp @@ -251,7 +251,7 @@ Status createCollectionForApplyOps(OperationContext* opCtx, // collection already exists under a different name. If so, rename it into place. As this is // done during replay of the oplog, the operations do not need to be atomic, just idempotent. // We need to do the renaming part in a separate transaction, as we cannot transactionally - // create a database on MMAPv1, which could result in createCollection failing if the database + // create a database, which could result in createCollection failing if the database // does not yet exist. if (ui) { // Return an optional, indicating whether we need to early return (if the collection already @@ -291,11 +291,7 @@ Status createCollectionForApplyOps(OperationContext* opCtx, // In the case of oplog replay, a future command may have created or renamed a // collection with that same name. In that case, renaming this future collection to // a random temporary name is correct: once all entries are replayed no temporary - // names will remain. On MMAPv1 the rename can result in index names that are too - // long. However this should only happen for initial sync and "resync collection" - // for rollback, so we can let the error propagate resulting in an abort and restart - // of the initial sync or result in rollback to fassert, requiring a resync of that - // node. + // names will remain. const bool stayTemp = true; auto futureColl = db ? CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, newCollName) diff --git a/src/mongo/db/catalog/rename_collection.cpp b/src/mongo/db/catalog/rename_collection.cpp index 08383c041bc..9272fd2e3ff 100644 --- a/src/mongo/db/catalog/rename_collection.cpp +++ b/src/mongo/db/catalog/rename_collection.cpp @@ -229,9 +229,6 @@ Status renameCollectionAndDropTarget(OperationContext* opCtx, // Target collection exists - drop it. invariant(options.dropTarget); - // If this rename collection is replicated, check for long index names in the target - // collection that may exceed the MMAPv1 namespace limit when the target collection - // is renamed with a drop-pending namespace. auto replCoord = repl::ReplicationCoordinator::get(opCtx); auto isOplogDisabledForNamespace = replCoord->isOplogDisabledFor(opCtx, target); if (!isOplogDisabledForNamespace) { diff --git a/src/mongo/db/s/session_catalog_migration_destination.cpp b/src/mongo/db/s/session_catalog_migration_destination.cpp index 1c9199b727f..8e9f5c4a89f 100644 --- a/src/mongo/db/s/session_catalog_migration_destination.cpp +++ b/src/mongo/db/s/session_catalog_migration_destination.cpp @@ -264,10 +264,9 @@ ProcessOplogResult processSessionOplog(const BSONObj& oplogBSON, NamespaceString::kSessionTransactionsTableNamespace.ns(), [&] { // Need to take global lock here so repl::logOp will not unlock it and trigger the - // invariant that disallows unlocking global lock while inside a WUOW. Grab a DBLock - // here instead of plain GlobalLock to make sure the MMAPV1 flush lock will be - // lock/unlocked correctly. Take the transaction table db lock to ensure the same lock - // ordering with normal replicated updates to the table. + // invariant that disallows unlocking global lock while inside a WUOW. Take the + // transaction table db lock to ensure the same lock ordering with normal replicated + // updates to the table. Lock::DBLock lk( opCtx, NamespaceString::kSessionTransactionsTableNamespace.db(), MODE_IX); WriteUnitOfWork wunit(opCtx); diff --git a/src/mongo/db/server_recovery.h b/src/mongo/db/server_recovery.h index 3b9d87a8065..52f9858ce4d 100644 --- a/src/mongo/db/server_recovery.h +++ b/src/mongo/db/server_recovery.h @@ -37,8 +37,7 @@ namespace mongo { /** - * This class is for use with non-MMAPv1 storage engines that track record store sizes in catalog - * metadata. + * This class is for use with storage engines that track record store sizes in catalog metadata. * * During normal server operation, we adjust the size metadata for all record stores. But when * performing replication recovery, we avoid doing so, as we trust that the size metadata on disk is diff --git a/src/mongo/util/processinfo.h b/src/mongo/util/processinfo.h index a65285ef134..732649d60b8 100644 --- a/src/mongo/util/processinfo.h +++ b/src/mongo/util/processinfo.h @@ -160,13 +160,6 @@ public: static bool blockInMemory(const void* start); /** - * Returns a positive floating point number between 0.0 and 1.0 to inform MMapV1 how much it - * must remap pages to bring the system page file implementation back below a certain - * threshold. A number of 1.0 means remap everything. - */ - static double getSystemMemoryPressurePercentage(); - - /** * @return a pointer aligned to the start of the page the provided pointer belongs to. * * NOTE requires blockCheckSupported() == true diff --git a/src/mongo/util/processinfo_freebsd.cpp b/src/mongo/util/processinfo_freebsd.cpp index d7f1d4127ca..f47e13e2b92 100644 --- a/src/mongo/util/processinfo_freebsd.cpp +++ b/src/mongo/util/processinfo_freebsd.cpp @@ -120,10 +120,6 @@ int ProcessInfo::getResidentSize() { return rss; } -double ProcessInfo::getSystemMemoryPressurePercentage() { - return 0.0; -} - void ProcessInfo::SystemInfo::collectSystemInfo() { osType = "BSD"; osName = "FreeBSD"; diff --git a/src/mongo/util/processinfo_linux.cpp b/src/mongo/util/processinfo_linux.cpp index 78c38ec996f..639f0f57e82 100644 --- a/src/mongo/util/processinfo_linux.cpp +++ b/src/mongo/util/processinfo_linux.cpp @@ -538,10 +538,6 @@ int ProcessInfo::getResidentSize() { return (int)((p.getResidentSizeInPages() * getPageSize()) / (1024.0 * 1024)); } -double ProcessInfo::getSystemMemoryPressurePercentage() { - return 0.0; -} - void ProcessInfo::getExtraInfo(BSONObjBuilder& info) { struct rusage ru; getrusage(RUSAGE_SELF, &ru); diff --git a/src/mongo/util/processinfo_openbsd.cpp b/src/mongo/util/processinfo_openbsd.cpp index 5736504ce9c..260acc84a20 100644 --- a/src/mongo/util/processinfo_openbsd.cpp +++ b/src/mongo/util/processinfo_openbsd.cpp @@ -130,10 +130,6 @@ int ProcessInfo::getResidentSize() { return rss; } -double ProcessInfo::getSystemMemoryPressurePercentage() { - return 0.0; -} - void ProcessInfo::SystemInfo::collectSystemInfo() { osType = "BSD"; osName = "OpenBSD"; diff --git a/src/mongo/util/processinfo_osx.cpp b/src/mongo/util/processinfo_osx.cpp index aab2f4e3fd7..4de98f203ca 100644 --- a/src/mongo/util/processinfo_osx.cpp +++ b/src/mongo/util/processinfo_osx.cpp @@ -116,10 +116,6 @@ int ProcessInfo::getResidentSize() { return (int)(ti.resident_size / (1024 * 1024)); } -double ProcessInfo::getSystemMemoryPressurePercentage() { - return 0.0; -} - void ProcessInfo::getExtraInfo(BSONObjBuilder& info) { struct task_events_info taskInfo; mach_msg_type_number_t taskInfoCount = TASK_EVENTS_INFO_COUNT; diff --git a/src/mongo/util/processinfo_solaris.cpp b/src/mongo/util/processinfo_solaris.cpp index 54ae6184fe2..61e509a1089 100644 --- a/src/mongo/util/processinfo_solaris.cpp +++ b/src/mongo/util/processinfo_solaris.cpp @@ -124,10 +124,6 @@ int ProcessInfo::getResidentSize() { return static_cast<int>(p.psinfo.pr_rssize / 1024); } -double ProcessInfo::getSystemMemoryPressurePercentage() { - return 0.0; -} - void ProcessInfo::getExtraInfo(BSONObjBuilder& info) { ProcUsage p; info.appendNumber("page_faults", static_cast<long long>(p.prusage.pr_majf)); diff --git a/src/mongo/util/processinfo_unknown.cpp b/src/mongo/util/processinfo_unknown.cpp index 05f84b7f22c..b77e79d8fae 100644 --- a/src/mongo/util/processinfo_unknown.cpp +++ b/src/mongo/util/processinfo_unknown.cpp @@ -51,10 +51,6 @@ int ProcessInfo::getResidentSize() { return -1; } -double ProcessInfo::getSystemMemoryPressurePercentage() { - return 0.0; -} - bool ProcessInfo::checkNumaEnabled() { return false; } diff --git a/src/mongo/util/processinfo_windows.cpp b/src/mongo/util/processinfo_windows.cpp index 31c0908fb32..b8a976fabcd 100644 --- a/src/mongo/util/processinfo_windows.cpp +++ b/src/mongo/util/processinfo_windows.cpp @@ -97,45 +97,6 @@ int ProcessInfo::getResidentSize() { return _wconvertmtos(pmc.WorkingSetSize); } -double ProcessInfo::getSystemMemoryPressurePercentage() { - MEMORYSTATUSEX mse; - mse.dwLength = sizeof(mse); - BOOL status = GlobalMemoryStatusEx(&mse); - if (!status) { - DWORD gle = GetLastError(); - LOGV2_ERROR(23814, - "GlobalMemoryStatusEx failed with {errnoWithDescription_gle}", - "errnoWithDescription_gle"_attr = errnoWithDescription(gle)); - fassert(28623, status); - } - - DWORDLONG totalPageFile = mse.ullTotalPageFile; - if (totalPageFile == 0) { - return false; - } - - // If the page file is >= 50%, say we are low on system memory - // If the page file is >= 75%, we are running very low on system memory - // - DWORDLONG highWatermark = totalPageFile / 2; - DWORDLONG veryHighWatermark = 3 * (totalPageFile / 4); - - DWORDLONG usedPageFile = mse.ullTotalPageFile - mse.ullAvailPageFile; - - // Below the watermark, we are fine - // Also check we will not do a divide by zero below - if (usedPageFile < highWatermark || veryHighWatermark <= highWatermark) { - return 0.0; - } - - // Above the high watermark, we tell MMapV1 how much to remap - // < 1.0, we have some pressure, but not much so do not be very aggressive - // 1.0 = we are at very high watermark, remap everything - // > 1.0, the user may run out of memory, remap everything - // i.e., Example (N - 50) / (75 - 50) - return static_cast<double>(usedPageFile - highWatermark) / (veryHighWatermark - highWatermark); -} - void ProcessInfo::getExtraInfo(BSONObjBuilder& info) { MEMORYSTATUSEX mse; mse.dwLength = sizeof(mse); |