head 1.5; access; symbols pkgsrc-2026Q1:1.5.0.22 pkgsrc-2026Q1-base:1.5 pkgsrc-2025Q4:1.5.0.20 pkgsrc-2025Q4-base:1.5 pkgsrc-2025Q3:1.5.0.18 pkgsrc-2025Q3-base:1.5 pkgsrc-2025Q2:1.5.0.16 pkgsrc-2025Q2-base:1.5 pkgsrc-2025Q1:1.5.0.14 pkgsrc-2025Q1-base:1.5 pkgsrc-2024Q4:1.5.0.12 pkgsrc-2024Q4-base:1.5 pkgsrc-2024Q3:1.5.0.10 pkgsrc-2024Q3-base:1.5 pkgsrc-2024Q2:1.5.0.8 pkgsrc-2024Q2-base:1.5 pkgsrc-2024Q1:1.5.0.6 pkgsrc-2024Q1-base:1.5 pkgsrc-2023Q4:1.5.0.4 pkgsrc-2023Q4-base:1.5 pkgsrc-2023Q3:1.5.0.2 pkgsrc-2023Q3-base:1.5 pkgsrc-2023Q2:1.4.0.28 pkgsrc-2023Q2-base:1.4 pkgsrc-2023Q1:1.4.0.26 pkgsrc-2023Q1-base:1.4 pkgsrc-2022Q4:1.4.0.24 pkgsrc-2022Q4-base:1.4 pkgsrc-2022Q3:1.4.0.22 pkgsrc-2022Q3-base:1.4 pkgsrc-2022Q2:1.4.0.20 pkgsrc-2022Q2-base:1.4 pkgsrc-2022Q1:1.4.0.18 pkgsrc-2022Q1-base:1.4 pkgsrc-2021Q4:1.4.0.16 pkgsrc-2021Q4-base:1.4 pkgsrc-2021Q3:1.4.0.14 pkgsrc-2021Q3-base:1.4 pkgsrc-2021Q2:1.4.0.12 pkgsrc-2021Q2-base:1.4 pkgsrc-2021Q1:1.4.0.10 pkgsrc-2021Q1-base:1.4 pkgsrc-2020Q4:1.4.0.8 pkgsrc-2020Q4-base:1.4 pkgsrc-2020Q3:1.4.0.6 pkgsrc-2020Q3-base:1.4 pkgsrc-2020Q2:1.4.0.4 pkgsrc-2020Q2-base:1.4 pkgsrc-2020Q1:1.4.0.2 pkgsrc-2020Q1-base:1.4 pkgsrc-2019Q4:1.3.0.10 pkgsrc-2019Q4-base:1.3 pkgsrc-2019Q3:1.3.0.6 pkgsrc-2019Q3-base:1.3 pkgsrc-2019Q2:1.3.0.4 pkgsrc-2019Q2-base:1.3 pkgsrc-2019Q1:1.3.0.2 pkgsrc-2019Q1-base:1.3 pkgsrc-2018Q4:1.2.0.16 pkgsrc-2018Q4-base:1.2 pkgsrc-2018Q3:1.2.0.14 pkgsrc-2018Q3-base:1.2 pkgsrc-2018Q2:1.2.0.12 pkgsrc-2018Q2-base:1.2 pkgsrc-2018Q1:1.2.0.10 pkgsrc-2018Q1-base:1.2 pkgsrc-2017Q4:1.2.0.8 pkgsrc-2017Q4-base:1.2 pkgsrc-2017Q3:1.2.0.6 pkgsrc-2017Q3-base:1.2 pkgsrc-2017Q2:1.2.0.2 pkgsrc-2017Q2-base:1.2 pkgsrc-2017Q1:1.1.0.10 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.8 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.6 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.4 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.2 pkgsrc-2016Q1-base:1.1; locks; strict; comment @// @; 1.5 date 2023.07.29.11.45.43; author adam; state Exp; branches; next 1.4; commitid E0zTHbOj74uTWGyE; 1.4 date 2020.02.01.20.00.08; author adam; state Exp; branches; next 1.3; commitid ZcVVcWW59SQWC0VB; 1.3 date 2019.03.05.19.35.58; author adam; state Exp; branches; next 1.2; commitid B1TIlNtSxgUvcdeB; 1.2 date 2017.06.24.04.24.56; author kamil; state Exp; branches; next 1.1; commitid MY3HGSzy03bK3AWz; 1.1 date 2016.02.12.03.37.24; author ryoon; state Exp; branches; next ; commitid IDlAvSFWNUM8OzUy; desc @@ 1.5 log @mongodb: updated to 6.0.8 https://www.mongodb.com/docs/manual/release-notes/6.0/ @ text @$NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.4 2020/02/01 20:00:08 adam Exp $ Add NetBSD support. --- src/mongo/util/processinfo_netbsd.cpp.orig 2023-07-26 08:58:34.000000000 +0000 +++ src/mongo/util/processinfo_netbsd.cpp @@@@ -26,6 +26,7 @@@@ * exception statement from all source files in the program, then also delete * it in the license file. */ +#define _KMEMUSER #define MONGO_LOGV2_DEFAULT_COMPONENT ::mongo::logv2::LogComponent::kControl @@@@ -38,7 +39,6 @@@@ #include #include #include -#include #include #include @@@@ -85,7 +85,7 @@@@ template <> int getSysctlByIDWithDefault(const int* sysctlID, const int idLen, const std::string& defaultValue, - string* result) { + std::string* result) { char value[256] = {0}; size_t len = sizeof(value); if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) { @@@@ -105,7 +105,7 @@@@ int ProcessInfo::getVirtualMemorySize() return -1; } - kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt); + kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt); int vss = ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) / 1048576; kvm_close(kd); @@@@ -120,7 +120,7 @@@@ int ProcessInfo::getResidentSize() { LOGV2(23344, "Unable to get res mem size: {err}", "err"_attr = err); return -1; } - kinfo_proc* task = kvm_getprocs(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt); + kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc), &cnt); int rss = (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576; // convert from pages to MB kvm_close(kd); return rss; @@@@ -128,7 +128,7 @@@@ int ProcessInfo::getResidentSize() { void ProcessInfo::SystemInfo::collectSystemInfo() { osType = "BSD"; - osName = "OpenBSD"; + osName = "NetBSD"; int mib[2]; mib[0] = CTL_KERN; @ 1.4 log @mongodb4: updated to 4.2.3 4.2.3: Issues fixed: SERVER-42565: Aggregations and find commands sort missing fields differently’ SERVER-44174: $push and $addToSet should restrict memory usage SERVER-40435: A clearJumboFlag command to clear the jumbo flag SERVER-45270: Increased vulnerability to slow DNS TOOLS-1952: Use –forceTableScan by default when running against WiredTiger nodes TOOLS-2453: Index keys not escaped correctly SERVER-45396: fix the “me” field in isMaster responses when using splithorizon SERVER-45309: Ensure bind credentials live longer than LDAP operations WT-5120: Checkpoint hangs when reconciliation doesn’t release the eviction generation 4.2.2: Issues fixed: SERVER-31083: Allow passing primary shard to “enableSharding” command for a new database SERVER-33272: The DatabaseHolder::close() function no longer requires a global write lock and neither does the dropDatabase command SERVER-44050: Arrays along ‘hashed’ index key path are not correctly rejected SERVER-43882: Building indexes for startup recovery uses unowned RecordData after yielding its cursor SERVER-44617: $regexFind crash when one of the capture group doesn’t match the input but pattern matches SERVER-44721: Shell KMS AWS support cannot decrypt responses WT-4961: Checkpoints with cache overflow must keep history for reads 4.2.1: Issues fixed: SERVER-37768: Platform Support: Add Community & Enterprise Debian 10 x64 SERVER-37772: Platform Support: Add Community & Enterprise RHEL 8 x64 SERVER-41506: Track metrics associated with a node calling an election SERVER-41499: Track number of elections called for each reason in serverStatus SERVER-42518: Wildcard index plans miss results when the query path has multiple subsequent array indexes SERVER-42856: Transactions with write can be sent to the wrong shard @ text @d1 1 a1 1 $NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.3 2019/03/05 19:35:58 adam Exp $ d5 1 a5 1 --- src/mongo/util/processinfo_netbsd.cpp.orig 2020-01-27 09:41:08.452841019 +0000 d13 1 a13 1 #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kControl d32 1 a32 1 @@@@ -109,7 +109,7 @@@@ int ProcessInfo::getVirtualMemorySize() d41 2 a42 2 @@@@ -124,7 +124,7 @@@@ int ProcessInfo::getResidentSize() { log() << "Unable to get res mem size: " << err; d50 1 a50 1 @@@@ -136,7 +136,7 @@@@ double ProcessInfo::getSystemMemoryPress @ 1.3 log @mongodb: updated to 4.0.6 4.0.6: Issues fixed: SERVER-37778: Platform Support: Add Community & Enterprise Ubuntu 18.04 (zSeries) SERVER-37777: Platform Support: Add Community SLES12 (zSeries) SERVER-37775: Platform Support: Add Community RHEL7 (zSeries) SERVER-39180: Wrong initial chunk owner shard can be selected when sharding non-empty collection with pre-created zones SERVER-32146: Log slow oplog entry application SERVER-38293: Make listDatabases understand collection privileges SERVER-38887: Mongo.getDBs() does not correctly inspect privileges 4.0.5: Issues fixed: SERVER-36437: The dbstats command should lock the database in MODE_IS instead of MODE_S SERVER-37182: Different values when referencing whole object vs. a field of that object after $arrayToObject SERVER-37200: $match stage following $listSessions not working against mongos SERVER-37557: Add startup warning about enableMajorityReadConcern and usage of arbiters 4.0.4: Issues fixed: SERVER-26854: LockStats for sub-operations should not include time for previous sub ops SERVER-35323: sessionId matching ignores userId part of the lsid SERVER-37058: Update with numeric field names inside an array can cause validation to fail SERVER-37132: Negation of $in with regex can incorrectly plan from the cache, leading to missing query results TOOLS-2069: mongoreplay does not support SCRAM-SHA-256 TOOLS-2131: mongorestore hang in replaying oplog with –archive and –oplogReplay option 4.0.3: Issues fixed: SERVER-19815: Make repair more robust with the WiredTiger storage engine SERVER-35989: db.collection.countDocuments() and db.collection.estimatedDocumentCount() helpers SERVER-36982: Reintroduce enableMajorityReadConcern:false server parameter 4.0.2: Issues fixed: SERVER-35720: Allow zones to be created on non-existent collection SERVER-35441: drop/dropDatabase does not cleanup config.tags SERVER-36102: Create initial chunks on appropriate shards for zoned sharding SERVER-36070: Aggregation with $out results in error when Auditing is enabled SERVER-34846: Covered index with collated field returns incorrect result when collation not involved in match or sort SERVER-34664: Commands that are unsupported in a transaction should error 4.0.1: Issues fixed: SERVER-33000: Platform Support: add Ubuntu 18.04. SERVER-34933: PCRE verb support. SERVER-35101: Handle bindIp argument that contains whitespaces. SERVER-36027: Enterprise build does not recognize the --redactClientLogData flag. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 NetBSD support. d5 1 a5 1 --- src/mongo/util/processinfo_netbsd.cpp.orig 2019-03-04 22:59:41.311405065 +0000 d7 1 a7 1 @@@@ -27,6 +27,7 @@@@ d15 1 a15 1 @@@@ -39,7 +40,6 @@@@ d23 10 a32 1 @@@@ -112,7 +112,7 @@@@ int ProcessInfo::getVirtualMemorySize() d41 1 a41 1 @@@@ -127,7 +127,7 @@@@ int ProcessInfo::getResidentSize() { d50 9 @ 1.2 log @Correct mongodb build failure on NetBSD 8.99.1 Address removal fallout. @ text @d1 1 a1 1 $NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.1 2016/02/12 03:37:24 ryoon Exp $ d3 3 a5 1 --- src/mongo/util/processinfo_netbsd.cpp.orig 2017-06-24 01:47:17.271883765 +0000 d7 4 a10 29 @@@@ -0,0 +1,212 @@@@ +/* Copyright 2012 10gen Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * 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 + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + * 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 GNU Affero General 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. + */ + +#if defined(__NetBSD__) d12 29 a40 183 +#endif + +#define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kControl + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mongo/util/scopeguard.h" +#include "mongo/util/log.h" +#include "processinfo.h" + +using namespace std; + +namespace mongo { + +ProcessInfo::ProcessInfo(ProcessId pid) : _pid(pid) {} + +ProcessInfo::~ProcessInfo() {} + +/** + * Get a sysctl string value by name. Use string specialization by default. + */ +template +int getSysctlByIDWithDefault(const int* sysctlID, + const int idLen, + const T& defaultValue, + T* result); + +template <> +int getSysctlByIDWithDefault(const int* sysctlID, + const int idLen, + const uintptr_t& defaultValue, + uintptr_t* result) { + uintptr_t value = 0; + size_t len = sizeof(value); + if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) { + *result = defaultValue; + return errno; + } + if (len > sizeof(value)) { + *result = defaultValue; + return EINVAL; + } + + *result = value; + return 0; +} + +template <> +int getSysctlByIDWithDefault(const int* sysctlID, + const int idLen, + const string& defaultValue, + string* result) { + char value[256] = {0}; + size_t len = sizeof(value); + if (sysctl(sysctlID, idLen, &value, &len, NULL, 0) == -1) { + *result = defaultValue; + return errno; + } + *result = value; + return 0; +} + +bool ProcessInfo::checkNumaEnabled() { + return false; +} + +int ProcessInfo::getVirtualMemorySize() { + kvm_t* kd = NULL; + int cnt = 0; + char err[_POSIX2_LINE_MAX] = {0}; + if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, err)) == NULL) { + log() << "Unable to get virt mem size: " << err << endl; + return -1; + } + + kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc2), &cnt); + kvm_close(kd); + return ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) / + 1048576; +} + +int ProcessInfo::getResidentSize() { + kvm_t* kd = NULL; + int cnt = 0; + char err[_POSIX2_LINE_MAX] = {0}; + if ((kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, err)) == NULL) { + log() << "Unable to get res mem size: " << err << endl; + return -1; + } + kinfo_proc2* task = kvm_getproc2(kd, KERN_PROC_PID, _pid.toNative(), sizeof(kinfo_proc2), &cnt); + kvm_close(kd); + return (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576; // convert from pages to MB +} + +double ProcessInfo::getSystemMemoryPressurePercentage() { + return 0.0; +} + +void ProcessInfo::SystemInfo::collectSystemInfo() { + osType = "BSD"; + osName = "NetBSD"; + int mib[2]; + + mib[0] = CTL_KERN; + mib[1] = KERN_VERSION; + int status = getSysctlByIDWithDefault(mib, 2, string("unknown"), &osVersion); + if (status != 0) + log() << "Unable to collect OS Version. (errno: " << status << " msg: " << strerror(status) + << ")" << endl; + + mib[0] = CTL_HW; + mib[1] = HW_MACHINE; + status = getSysctlByIDWithDefault(mib, 2, string("unknown"), &cpuArch); + if (status != 0) + log() << "Unable to collect Machine Architecture. (errno: " << status + << " msg: " << strerror(status) << ")" << endl; + addrSize = cpuArch.find("64") != std::string::npos ? 64 : 32; + + uintptr_t numBuffer; + uintptr_t defaultNum = 1; + mib[0] = CTL_HW; + mib[1] = HW_PHYSMEM; + status = getSysctlByIDWithDefault(mib, 2, defaultNum, &numBuffer); + memSize = numBuffer; + if (status != 0) + log() << "Unable to collect Physical Memory. (errno: " << status + << " msg: " << strerror(status) << ")" << endl; + + mib[0] = CTL_HW; + mib[1] = HW_NCPU; + status = getSysctlByIDWithDefault(mib, 2, defaultNum, &numBuffer); + numCores = numBuffer; + if (status != 0) + log() << "Unable to collect Number of CPUs. (errno: " << status + << " msg: " << strerror(status) << ")" << endl; + + pageSize = static_cast(sysconf(_SC_PAGESIZE)); + + hasNuma = checkNumaEnabled(); +} + +void ProcessInfo::getExtraInfo(BSONObjBuilder& info) {} + +bool ProcessInfo::supported() { + return true; +} + +bool ProcessInfo::blockCheckSupported() { + return true; +} + +bool ProcessInfo::blockInMemory(const void* start) { + char x = 0; + if (mincore((void*)alignToStartOfPage(start), getPageSize(), &x)) { + log() << "mincore failed: " << errnoWithDescription() << endl; + return 1; + } + return x & 0x1; +} + +bool ProcessInfo::pagesInMemory(const void* start, size_t numPages, vector* out) { + out->resize(numPages); + // int mincore(const void *addr, size_t len, char *vec); + if (mincore((void*)alignToStartOfPage(start), numPages * getPageSize(), &(out->front()))) { + log() << "mincore failed: " << errnoWithDescription() << endl; + return false; + } + for (size_t i = 0; i < numPages; ++i) { + (*out)[i] = 0x1; + } + return true; +} +} @ 1.1 log @Update to 3.2.1 * Change JavaScript engine from V8 to SpiderMonkey. Changelog: 3.2.1 – Jan 12, 2016 Fixed error where during a regular shutdown of a replica set, secondaries may mark certain replicated but yet to be applied operations as successfully applied: SERVER-21868. Improve insert workload performance with WiredTiger on Windows: SERVER-20262. Fixed long-running transactions during chunk moves: SERVER-21366 All issues closed in 3.2.1 3.0.9 – Jan 26, 2016 Fixed issue where queries which specify sort and batch size can return results out of order if documents are concurrently updated. SERVER-19996 Fixed performance issue where large amounts of create and drop collections can cause listDatabases to be slow under WiredTiger. SERVER-20961 Modified the authentication failure message to include the client IP address. SERVER-22054 All issues closed in 3.0.9 3.0.8 – Dec 15, 2015 Fixed issue where findAndModify on mongos can upsert to the wrong shard. SERVER-20407. Fixed WiredTiger commit visibility issue which caused document not found. SERVER-21275. Fixed issue where the oplog can grow to 3x configured size. SERVER-21553 All issues closed in 3.0.8 @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- src/mongo/util/processinfo_netbsd.cpp.orig 2016-02-11 22:14:23.486964953 +0000 d5 1 a5 1 @@@@ -0,0 +1,213 @@@@ a47 1 +#include @