Merge pull request #10723 from klaussner/mongodb-4.2

Update MongoDB to 4.2
This commit is contained in:
Ben Newman
2020-01-13 17:39:55 -05:00
committed by GitHub
9 changed files with 58 additions and 46 deletions

View File

@@ -11,6 +11,12 @@ N/A
### Changes
* The version of MongoDB used by Meteor in development has been updated
from 4.0.6 to 4.2.1, and the `mongodb` driver package has been updated
from 3.2.7 to 3.4.0, thanks to [@klaussner](https://github.com/klaussner).
[Feature #361](https://github.com/meteor/meteor-feature-requests/issues/361)
[PR #10723](https://github.com/meteor/meteor/pull/10723)
* Cordova was updated from version 7 to 9
* cordova-lib from 7.1.0 to 9.0.1 [release notes](https://github.com/apache/cordova-lib/blob/master/RELEASENOTES.md)
* cordova-common from 2.1.1 to 3.2.1 [release notes](https://github.com/apache/cordova-common/blob/master/RELEASENOTES.md)

2
meteor
View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
BUNDLE_VERSION=12.14.0.4
BUNDLE_VERSION=12.14.0.5
# OS Check. Put here because here is where we download the precompiled
# bundles that are arch specific.

View File

@@ -140,8 +140,8 @@ MongoConnection = function (url, options) {
// default), with each attempt separated by 1000ms.
reconnectTries: Infinity,
ignoreUndefined: true,
// Required to silence deprecation warnings with mongodb@3.1.1.
useNewUrlParser: true,
// Required to silence deprecation warnings with mongodb@3.2.1.
useUnifiedTopology: true,
}, Mongo._connectionOptions);
// Disable the native parser by default, unless specifically enabled

View File

@@ -2,9 +2,9 @@
"lockfileVersion": 1,
"dependencies": {
"bson": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.1.1.tgz",
"integrity": "sha512-jCGVYLoYMHDkOsbwJZBCqwMHyH4c+wzgI9hG7Z6SZJRXWr+x58pdIbm2i9a/jFGCkRJqRUr8eoI7lDWa0hTkxg=="
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/bson/-/bson-1.1.3.tgz",
"integrity": "sha512-TdiJxMVnodVS7r0BdL42y/pqC9cL2iKynVwA0Ho3qbsQYr428veL3l7BQyuqiw+Q5SqqoT0m4srSY/BlZ9AxXg=="
},
"memory-pager": {
"version": "1.5.0",
@@ -12,14 +12,9 @@
"integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg=="
},
"mongodb": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.2.7.tgz",
"integrity": "sha512-2YdWrdf1PJgxcCrT1tWoL6nHuk6hCxhddAAaEh8QJL231ci4+P9FLyqopbTm2Z2sAU6mhCri+wd9r1hOcHdoMw=="
},
"mongodb-core": {
"version": "3.2.7",
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.2.7.tgz",
"integrity": "sha512-WypKdLxFNPOH/Jy6i9z47IjG2wIldA54iDZBmHMINcgKOUcWJh8og+Wix76oGd7EyYkHJKssQ2FAOw5Su/n4XQ=="
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.4.0.tgz",
"integrity": "sha512-W90jm/n8F0Edm47ljkVRK9l8qGW9g8T9ZSiZWRiUP58wLhsCJCeN/JxdpVnH0CUwwAw2hITUcCo9x58udpX2Uw=="
},
"require_optional": {
"version": "1.0.1",
@@ -32,9 +27,9 @@
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c="
},
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg=="
},
"saslprep": {
"version": "1.0.3",
@@ -42,9 +37,9 @@
"integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag=="
},
"semver": {
"version": "5.7.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA=="
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
},
"sparse-bitfield": {
"version": "3.0.3",

View File

@@ -3,12 +3,12 @@
Package.describe({
summary: "Wrapper around the mongo npm package",
version: "3.3.0",
version: "3.4.0",
documentation: null
});
Npm.depends({
mongodb: "3.2.7"
mongodb: "3.4.0"
});
Package.onUse(function (api) {

View File

@@ -6,7 +6,7 @@ set -u
UNAME=$(uname)
ARCH=$(uname -m)
NODE_VERSION=12.14.0
MONGO_VERSION_64BIT=4.0.6
MONGO_VERSION_64BIT=4.2.1
MONGO_VERSION_32BIT=3.2.22
NPM_VERSION=6.13.4
@@ -40,7 +40,7 @@ elif [ "$UNAME" == "Darwin" ] ; then
exit 1
fi
OS="osx"
OS="macos"
# We don't strip on Mac because we don't know a safe command. (Can't strip
# too much because we do need node to be able to load objects like

View File

@@ -232,7 +232,7 @@ Function Add-Mongo {
# the latest 3.2 version of Mongo for those builds and >= 3.4 for x64.
$mongo_filenames = @{
windows_x86 = "mongodb-win32-i386-${MONGO_VERSION_32BIT}"
windows_x64 = "mongodb-win32-x86_64-2008plus-ssl-${MONGO_VERSION_64BIT}"
windows_x64 = "mongodb-win32-x86_64-2012plus-${MONGO_VERSION_64BIT}"
}
$previousCwd = $PWD

View File

@@ -52,29 +52,29 @@ downloadReleaseCandidateNode() {
extractNodeFromTarGz || downloadNodeFromS3 || \
downloadOfficialNode || downloadReleaseCandidateNode
# Download Mongo from mongodb.com. Will download a 64-bit version of Mongo
# by default. Will download a 32-bit version of Mongo if using a 32-bit based
# OS.
# On macOS, download MongoDB from mongodb.com. On Linux, download a custom build
# that is compatible with current distributions. If a 32-bit Linux is used,
# download a 32-bit legacy version from mongodb.com instead.
MONGO_VERSION=$MONGO_VERSION_64BIT
MONGO_SSL="-ssl"
# The MongoDB "Generic" Linux option is not offered with SSL, which is reserved
# for named distributions. This works out better since the SSL support adds
# size to the dev bundle though isn't necessary for local development.
if [ $UNAME = "Linux" ]; then
MONGO_SSL=""
if [ $ARCH = "i686" ] && [ $OS = "linux" ]; then
MONGO_VERSION=$MONGO_VERSION_32BIT
fi
if [ $ARCH = "i686" ]; then
MONGO_VERSION=$MONGO_VERSION_32BIT
fi
case $OS in
macos) MONGO_BASE_URL="https://fastdl.mongodb.org/osx" ;;
linux)
[ $ARCH = "i686" ] &&
MONGO_BASE_URL="https://fastdl.mongodb.org/linux" ||
MONGO_BASE_URL="https://github.com/meteor/mongodb-builder/releases/download/${MONGO_VERSION}"
;;
esac
MONGO_NAME="mongodb-${OS}-${ARCH}-${MONGO_VERSION}"
MONGO_NAME_SSL="mongodb-${OS}${MONGO_SSL}-${ARCH}-${MONGO_VERSION}"
MONGO_TGZ="${MONGO_NAME_SSL}.tgz"
MONGO_URL="http://fastdl.mongodb.org/${OS}/${MONGO_TGZ}"
MONGO_TGZ="${MONGO_NAME}.tgz"
MONGO_URL="${MONGO_BASE_URL}/${MONGO_TGZ}"
echo "Downloading Mongo from ${MONGO_URL}"
curl "${MONGO_URL}" | tar zx
curl -L "${MONGO_URL}" | tar zx
# Put Mongo binaries in the right spot (mongodb/bin)
mkdir -p "mongodb/bin"

View File

@@ -56,7 +56,18 @@ function spawnMongod(mongodPath, port, dbPath, replSetName) {
// initializes faster. (Not recommended for production!)
'--oplogSize', '8',
'--replSet', replSetName,
'--noauth'
'--noauth',
// Starting with version 4.0.8/4.1.10, MongoDB performs a step down
// procedure if the primary receives a SIGTERM signal
// (https://jira.mongodb.org/browse/SERVER-38994). During this procedure,
// the process doesn't shut down for up to ten seconds until a secondary
// becomes the new primary. Since Meteor starts a single-node replica set,
// this is unnecessary because there are no secondaries. The following
// parameter disables the step down. This will be the default for single-
// node replica sets in MongoDB 4.3 (relevant commit: https://git.io/JeNkT),
// so the parameter can be removed in the future.
'--setParameter', 'waitForStepDownOnNonCommandShutdown=false'
];
// Use mmapv1 on 32bit platforms, as our binary doesn't support WT
@@ -65,10 +76,10 @@ function spawnMongod(mongodPath, port, dbPath, replSetName) {
} else if (process.platform !== 'linux') {
// MongoDB 4, which we use on 64-bit systems, displays a banner in the
// Mongo shell about a free monitoring service, which can be disabled
// with this flag. However, the generic Linux build (without SSL; see
// MONGO_SSL in scripts/generate-dev-bundle.sh) neither displays the
// banner nor supports the flag, so it's safe/important to avoid
// passing the flag to mongod on 64-bit linux.
// with this flag. However, the custom Linux build (see MONGO_BASE_URL
// in scripts/generate-dev-bundle.sh) neither displays the banner nor
// supports the flag, so it's safe/important to avoid passing the flag
// to mongod on 64-bit linux.
args.push('--enableFreeMonitoring', 'off');
}