head 1.2; access; symbols pkgsrc-2026Q1:1.2.0.54 pkgsrc-2026Q1-base:1.2 pkgsrc-2025Q4:1.2.0.52 pkgsrc-2025Q4-base:1.2 pkgsrc-2025Q3:1.2.0.50 pkgsrc-2025Q3-base:1.2 pkgsrc-2025Q2:1.2.0.48 pkgsrc-2025Q2-base:1.2 pkgsrc-2025Q1:1.2.0.46 pkgsrc-2025Q1-base:1.2 pkgsrc-2024Q4:1.2.0.44 pkgsrc-2024Q4-base:1.2 pkgsrc-2024Q3:1.2.0.42 pkgsrc-2024Q3-base:1.2 pkgsrc-2024Q2:1.2.0.40 pkgsrc-2024Q2-base:1.2 pkgsrc-2024Q1:1.2.0.38 pkgsrc-2024Q1-base:1.2 pkgsrc-2023Q4:1.2.0.36 pkgsrc-2023Q4-base:1.2 pkgsrc-2023Q3:1.2.0.34 pkgsrc-2023Q3-base:1.2 pkgsrc-2023Q2:1.2.0.32 pkgsrc-2023Q2-base:1.2 pkgsrc-2023Q1:1.2.0.30 pkgsrc-2023Q1-base:1.2 pkgsrc-2022Q4:1.2.0.28 pkgsrc-2022Q4-base:1.2 pkgsrc-2022Q3:1.2.0.26 pkgsrc-2022Q3-base:1.2 pkgsrc-2022Q2:1.2.0.24 pkgsrc-2022Q2-base:1.2 pkgsrc-2022Q1:1.2.0.22 pkgsrc-2022Q1-base:1.2 pkgsrc-2021Q4:1.2.0.20 pkgsrc-2021Q4-base:1.2 pkgsrc-2021Q3:1.2.0.18 pkgsrc-2021Q3-base:1.2 pkgsrc-2021Q2:1.2.0.16 pkgsrc-2021Q2-base:1.2 pkgsrc-2021Q1:1.2.0.14 pkgsrc-2021Q1-base:1.2 pkgsrc-2020Q4:1.2.0.12 pkgsrc-2020Q4-base:1.2 pkgsrc-2020Q3:1.2.0.10 pkgsrc-2020Q3-base:1.2 pkgsrc-2020Q2:1.2.0.8 pkgsrc-2020Q2-base:1.2 pkgsrc-2020Q1:1.2.0.4 pkgsrc-2020Q1-base:1.2 pkgsrc-2019Q4:1.2.0.6 pkgsrc-2019Q4-base:1.2 pkgsrc-2019Q3:1.2.0.2 pkgsrc-2019Q3-base:1.2 pkgsrc-2019Q2:1.1.0.2 pkgsrc-2019Q2-base:1.1; locks; strict; comment @// @; 1.2 date 2019.07.09.07.28.30; author adam; state Exp; branches; next 1.1; commitid tHTascq1CbDz7luB; 1.1 date 2019.06.28.16.30.56; author gdt; state Exp; branches; next ; commitid aIba1yK4vsq9tYsB; desc @@ 1.2 log @mongodb3: updated to 3.4.21 3.4.21: Issues fixed: SERVER-39820: Add the client IP address to the successful authentication log message SERVER-41213: Unique background index builds may produce inconsistent keys SERVER-37765: Platform Support: Remove Ubuntu 14.04 SERVER-37774: Platform Support: Remove Enterprise Ubuntu 16.04 PPCLE WT-4615: Sync backup file before returning backup cursor 3.4.20: Issues fixed: SERVER-39166: $graphLookup should force a pipeline to split in sharded cluster SERVER-39723: Change listIndexes command behavior to show in-progress index builds TOOLS-2158: mongodump failing on Windows with “error opening system CA store: Access is denied.” 3.4.19: Issues fixed: SERVER-18985: setParameter should log at level 0 SERVER-22766: Dynamic oplog sizing for WiredTiger nodes SERVER-33469: Make syslog log lines consistent with mongod log lines SERVER-37132: Negation of $in with regex can incorrectly plan from the cache, leading to missing query results SERVER-37182: Different values when referencing whole object vs. a field of that object after $arrayToObject SERVER-37616: Implement tuneable batch size for the rangedeleter 3.4.18: Issues fixed: SERVER-25175: listIndexes shouldn’t include in-progress background indexes SERVER-35418: Allow specifying CAs for incoming and outgoing connections separately. SERVER-36944: applyOps does not permit unknown field names when creating a v:1 index. SERVER-37058: Update with numeric field names inside an array can cause validation to fail. 3.4.17: Issues fixed: SERVER-33857 Missing log redaction due to confusion with Command::redactForLogging(). SERVER-34846 Covered index with collated field returns incorrect result when collation not involved in match or sort. SERVER-36010 Change log messages for Windows stacktraces to use error() or severe() rather than log(). SERVER-34558: Add SSL_version to client metadata logging. 3.4.16: Issues fixed: SERVER-32999: Platform Support: Remove Debian 7 builds. SERVER-29301: Upgrade MozJS to ESR 45.9.0 SERVER-5461: Add syncSourceHost field to replSetGetStatus output. 3.4.15: Issues fixed: SERVER-31535: Platform Support: remove Ubuntu 12.04 builds. SERVER-32923: Platform Support: remove SLES11 builds. SERVER-20056: Log a startup warning if wiredTigerCacheSizeGB is > 80% of RAM. SERVER-28981: Sharding balancer prefers shards in a specific order when moving chunks. 3.4.14: Issues fixed: SERVER-28151: Authentication database should be synced first during an initial sync. SERVER-32886: Unnecessary sleeps during chunk migration. SERVER-32933: Allow mongod to start when unable to reach LDAP server. 3.4.13: Issues fixed: SERVER-33238: Prevent WiredTiger read ticket count from going negative. 3.4.12: Issues fixed: SERVER-31437: Fix parsing of mongo host/db connect string. SERVER-32875: Don’t stall ftdc due to running out of tickets. SERVER-33089: Unable to start queryable mongod because it failed to regenerate index for admin.system.users. 3.4.11: Issues fixed: SERVER-19605: Oplog timeout should be configurable. SERVER-19919: Chunks that exceed 250000 docs but are under half chunk size get marked as jumbo. SERVER-29293: Recipient shard fails to abort migration on stepdown. SERVER-32001: unindexing a key in a partial unique index may cause server crash 3.4.10: Issues fixed: SERVER-15723: Avoid G_X lock for rename_collection within database SERVER-31049: View with collation doesn’t work as expected in sharded cluster SERVER-29287: Upgrade pcre to 8.41 SERVER-31204: Calling shardCollection after enableSharding may fail if executed against different mongos 3.4.9: Issues fixed: SERVER-20392: Sharding an existing small collection results in large number of chunks SERVER-30189: Reduce calls to allocator for large $in expressions SERVER-30487: RangeDeleter holds WT transaction open while waiting for majority SERVER-30636: Range deleter assert failed because of replication lag 3.4.7: Issues fixed: SERVER-29282: BSON Document Size can be exceeded when grouping inserts on SECONDARY nodes SERVER-29568: Enable configuration of OpenSSL cipher suite via setParameter SERVER-29817: Optimize incremental update performance of ChunkManager and CollectionMetadata 3.4.6: Issues fixed: SERVER-27347: Only close idle cached cursors on the WiredTiger ident that is busy. SERVER-29618: $geoWithin in aggregation pipeline after $lookup and $unwind returns incorrect results. WT-3362: Cursor opens should never block for the duration of a checkpoint. 3.4.5: Issues fixed: SERVER-28952: Multikey indexes should not be eligible for DISTINCT_SCAN if distinct key is an array component. SERVER-28427: GlobalLock with timeout can still block indefinitely. SERVER-29018 mongos can segfault in getMore on views with find batchSize of 0. @ text @$NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.1 2019/06/28 16:30:56 gdt Exp $ Add NetBSD support. --- src/mongo/util/processinfo_netbsd.cpp.orig 2019-07-08 19:34:24.000000000 +0000 +++ src/mongo/util/processinfo_netbsd.cpp @@@@ -25,6 +25,8 @@@@ * then also delete it in the license file. */ +#define _KMEMUSER + #define MONGO_LOG_DEFAULT_COMPONENT ::mongo::logger::LogComponent::kControl #include @@@@ -36,7 +38,6 @@@@ #include #include #include -#include #include #include @@@@ -109,7 +110,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_proc2), &cnt); kvm_close(kd); return ((task->p_vm_dsize + task->p_vm_ssize + task->p_vm_tsize) * sysconf(_SC_PAGESIZE)) / 1048576; @@@@ -123,7 +124,7 @@@@ int ProcessInfo::getResidentSize() { log() << "Unable to get res mem size: " << 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_proc2), &cnt); kvm_close(kd); return (task->p_vm_rssize * sysconf(_SC_PAGESIZE)) / 1048576; // convert from pages to MB } @@@@ -134,7 +135,7 @@@@ double ProcessInfo::getSystemMemoryPress void ProcessInfo::SystemInfo::collectSystemInfo() { osType = "BSD"; - osName = "OpenBSD"; + osName = "NetBSD"; int mib[2]; mib[0] = CTL_KERN; @ 1.1 log @databases/mongodb3: Add, to ameliorate problems with mongodb 4 This is a copy of mongodb before the update to 4, with annotations to explain why it exists. Reasons include: - mongodb 4 is licensed under the Server Side Public License, to which some have objected - mongodb 4 requires c++17 (and hence gcc 8) (ok to add during freeze by wiz@@) @ text @d1 1 a1 1 $NetBSD: patch-src_mongo_util_processinfo__netbsd.cpp,v 1.2 2017/06/24 04:24:56 kamil 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__) a11 84 +#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; + } d13 16 d30 8 a37 13 + 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; + } d39 8 a46 10 + 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"; d48 3 a50 72 + 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; +} +} @