From 542ad06b75a3ca2174c740bc6af900f9506dabb6 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 1 Feb 2018 12:22:04 -0500 Subject: [PATCH 1/8] Revert the revert of "Upgrade to Mongo 3.6 (#9533)" This reverts commit 85d74f8d2be3b26f29ea51723a2241441bf7aa25. --- History.md | 4 ++++ packages/npm-mongo/.npm/package/npm-shrinkwrap.json | 12 ++++++------ packages/npm-mongo/package.js | 4 ++-- scripts/admin/test-packages-with-mongo-versions.rb | 6 +++--- scripts/build-dev-bundle-common.sh | 4 ++-- scripts/generate-dev-bundle.ps1 | 6 +++--- scripts/generate-dev-bundle.sh | 13 ++++++++++++- tools/runners/run-mongo.js | 3 --- 8 files changed, 32 insertions(+), 20 deletions(-) diff --git a/History.md b/History.md index 618f35e7b23..5de253a71e6 100644 --- a/History.md +++ b/History.md @@ -447,6 +447,10 @@ [Issue #5127](https://github.com/meteor/meteor/issues/5127) [PR #9512](https://github.com/meteor/meteor/pull/9512) +* Mongo has been upgraded to version 3.6.2 for 64-bit OS', and 3.2.18 for + 32-bit OS'. + [PR #9533](https://github.com/meteor/meteor/pull/9533) + ## v1.6.0.1, 2017-12-08 * Node has been upgraded to version diff --git a/packages/npm-mongo/.npm/package/npm-shrinkwrap.json b/packages/npm-mongo/.npm/package/npm-shrinkwrap.json index 20b3c06fa61..d6e057fd05f 100644 --- a/packages/npm-mongo/.npm/package/npm-shrinkwrap.json +++ b/packages/npm-mongo/.npm/package/npm-shrinkwrap.json @@ -32,14 +32,14 @@ "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "mongodb": { - "version": "2.2.33", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.33.tgz", - "integrity": "sha1-tTfEcdNKZlG0jzb9vyl1A0Dgi1A=" + "version": "2.2.34", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.34.tgz", + "integrity": "sha1-o09Zu+thdUrsQy3nLD/iFSakTBo=" }, "mongodb-core": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.17.tgz", - "integrity": "sha1-pBizN6FKFJkPtRC5I97mqBMXPfg=" + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.18.tgz", + "integrity": "sha1-TEYTm986HwMt7ZHbSfOO7AFlkFA=" }, "process-nextick-args": { "version": "1.0.7", diff --git a/packages/npm-mongo/package.js b/packages/npm-mongo/package.js index 20bd672cb6d..ee92ce74456 100644 --- a/packages/npm-mongo/package.js +++ b/packages/npm-mongo/package.js @@ -3,12 +3,12 @@ Package.describe({ summary: "Wrapper around the mongo npm package", - version: "2.2.33", + version: "2.2.34", documentation: null }); Npm.depends({ - mongodb: "2.2.33" + mongodb: "2.2.34" }); Package.onUse(function (api) { diff --git a/scripts/admin/test-packages-with-mongo-versions.rb b/scripts/admin/test-packages-with-mongo-versions.rb index 9ffff7808fd..7ebb703bdb2 100755 --- a/scripts/admin/test-packages-with-mongo-versions.rb +++ b/scripts/admin/test-packages-with-mongo-versions.rb @@ -7,8 +7,8 @@ require 'tmpdir' mongo_install_urls = { - "3.4.9" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.9.tgz", - "3.2.15" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.15.tgz", + "3.6.2" => "https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-3.6.2.tgz", + "3.2.18" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.15.tgz", "3.0.5" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.0.5.tgz", "2.6.10" => "http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.10.tgz" } @@ -29,7 +29,7 @@ test_env = "TEST_PACKAGES_EXCLUDE=\"less\"" -["3.4.9", "3.2.15", "3.0.5", "2.6.10"].each do |mongo_version| +["3.6.2", "3.2.18", "3.0.5", "2.6.10"].each do |mongo_version| puts "Installing and testing with Mongo #{mongo_version}..." Dir.mktmpdir "mongo_install" do |mongo_install_dir| diff --git a/scripts/build-dev-bundle-common.sh b/scripts/build-dev-bundle-common.sh index ac525b826f4..dc88380544c 100644 --- a/scripts/build-dev-bundle-common.sh +++ b/scripts/build-dev-bundle-common.sh @@ -6,8 +6,8 @@ set -u UNAME=$(uname) ARCH=$(uname -m) NODE_VERSION=8.9.4 -MONGO_VERSION_64BIT=3.4.10 -MONGO_VERSION_32BIT=3.2.15 +MONGO_VERSION_64BIT=3.6.2 +MONGO_VERSION_32BIT=3.2.18 NPM_VERSION=5.6.0 # If we built Node from source on Jenkins, this is the build number. diff --git a/scripts/generate-dev-bundle.ps1 b/scripts/generate-dev-bundle.ps1 index 37f34419175..5b0058aa1e7 100644 --- a/scripts/generate-dev-bundle.ps1 +++ b/scripts/generate-dev-bundle.ps1 @@ -219,11 +219,11 @@ Function Add-NodeAndNpm { } Function Add-Mongo { - # Mongo 3.4 no longer supports 32-bit (x86) architectures, so we package - # the latest 3.2 version of Mongo for those builds and 3.4+ for x64. + # Mongo >= 3.4 no longer supports 32-bit (x86) architectures, so we package + # 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-${MONGO_VERSION_64BIT}" + windows_x64 = "mongodb-win32-x86_64-2008plus-ssl-${MONGO_VERSION_64BIT}" } $previousCwd = $PWD diff --git a/scripts/generate-dev-bundle.sh b/scripts/generate-dev-bundle.sh index c00892b5316..ab1f7572c11 100755 --- a/scripts/generate-dev-bundle.sh +++ b/scripts/generate-dev-bundle.sh @@ -49,11 +49,22 @@ extractNodeFromTarGz || downloadNodeFromS3 || downloadOfficialNode # by default. Will download a 32-bit version of Mongo if using a 32-bit based # OS. 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="" +fi + if [ $ARCH = "i686" ]; then MONGO_VERSION=$MONGO_VERSION_32BIT fi + MONGO_NAME="mongodb-${OS}-${ARCH}-${MONGO_VERSION}" -MONGO_TGZ="${MONGO_NAME}.tgz" +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}" echo "Downloading Mongo from ${MONGO_URL}" curl "${MONGO_URL}" | tar zx diff --git a/tools/runners/run-mongo.js b/tools/runners/run-mongo.js index 8870155dd1d..265277ed702 100644 --- a/tools/runners/run-mongo.js +++ b/tools/runners/run-mongo.js @@ -61,9 +61,6 @@ function spawnMongod(mongodPath, port, dbPath, replSetName) { // Use mmapv1 on 32bit platforms, as our binary doesn't support WT if (process.arch === 'ia32') { args.push('--storageEngine', 'mmapv1', '--smallfiles'); - } else { - // The WT journal seems to be at least 300MB, which is just too much - args.push('--nojournal'); } return child_process.spawn(mongodPath, args, { From 824d2d613b8c796897ae9df5da65fb6ffce06b9d Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 2 Feb 2018 12:21:43 -0500 Subject: [PATCH 2/8] Adjust accounts connection close delay for tests The accounts system `logoutOtherClients` method is using a connection close delay to make sure clients have a chance to get updated tokens, before older tokens are removed. Certain tests are setting this delay to 0, to help speed things up. The Meteor Mongo 3.6 changes have brought back in the need to use Mongo journaling, since the ability to disable journaling has been deprecated by Mongo. This means there is now a slight performance hit on certain Mongo operations, due to the increased time needed to cover the write to disk. This slight performance hit is causing the tests that use the 0 connection close delay to fail, since they are not waiting long enough for clients to get updated tokens, before they're removed. These changes increase the test connection close delay, to fix the failing tests. --- packages/accounts-base/accounts_server.js | 12 ++++++++---- packages/accounts-password/password_tests.js | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/accounts-base/accounts_server.js b/packages/accounts-base/accounts_server.js index eb9d679b689..cbe3b68a145 100644 --- a/packages/accounts-base/accounts_server.js +++ b/packages/accounts-base/accounts_server.js @@ -556,8 +556,9 @@ Ap._initServerMethods = function () { // Delete all the current user's tokens and close all open connections logged // in as this user. Returns a fresh new login token that this client can - // use. Tests set Accounts._noConnectionCloseDelayForTest to delete tokens - // immediately instead of using a delay. + // use. Tests can override the default connection close delay + // (stored in CONNECTION_CLOSE_DELAY_MS) by setting + // Accounts._connectionCloseDelayMsForTests. // // XXX COMPAT WITH 0.7.2 // This single `logoutOtherClients` method has been replaced with two @@ -594,12 +595,15 @@ Ap._initServerMethods = function () { }, $push: { "services.resume.loginTokens": accounts._hashStampedToken(newToken) } }); + const connectionCloseDelay = + accounts._connectionCloseDelayMsForTests + ? accounts._connectionCloseDelayMsForTests + : CONNECTION_CLOSE_DELAY_MS; Meteor.setTimeout(function () { // The observe on Meteor.users will take care of closing the connections // associated with `tokens`. accounts._deleteSavedTokensForUser(userId, tokens); - }, accounts._noConnectionCloseDelayForTest ? 0 : - CONNECTION_CLOSE_DELAY_MS); + }, connectionCloseDelay); // We do not set the login token on this connection, but instead the // observe closes the connection and the client will reconnect with the // new token. diff --git a/packages/accounts-password/password_tests.js b/packages/accounts-password/password_tests.js index 754c64b3f3a..636ee1d4909 100644 --- a/packages/accounts-password/password_tests.js +++ b/packages/accounts-password/password_tests.js @@ -1,4 +1,4 @@ -Accounts._noConnectionCloseDelayForTest = true; +Accounts._connectionCloseDelayMsForTests = 1000; if (Meteor.isServer) { Accounts.removeDefaultRateLimit(); From aca266d1f5bb71bc3606c25f17e32c2690b06d08 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 2 Feb 2018 12:26:12 -0500 Subject: [PATCH 3/8] Add back in the missing History entry --- History.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/History.md b/History.md index 5de253a71e6..aa5fe5d387f 100644 --- a/History.md +++ b/History.md @@ -106,6 +106,9 @@ [Feature #24](https://github.com/meteor/meteor-feature-requests/issues/24) [PR #9657](https://github.com/meteor/meteor/pull/9657) +* Mongo has been upgraded to version 3.6.2 for 64-bit OS', and 3.2.18 for + 32-bit OS'. + ## v1.6.1, 2018-01-19 * Node has been updated to version From ec840e1e0deda917210a10e40304d2763f803430 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 2 Feb 2018 12:27:52 -0500 Subject: [PATCH 4/8] Removed the now invalid History entry --- History.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/History.md b/History.md index aa5fe5d387f..c69ad9949ff 100644 --- a/History.md +++ b/History.md @@ -450,10 +450,6 @@ [Issue #5127](https://github.com/meteor/meteor/issues/5127) [PR #9512](https://github.com/meteor/meteor/pull/9512) -* Mongo has been upgraded to version 3.6.2 for 64-bit OS', and 3.2.18 for - 32-bit OS'. - [PR #9533](https://github.com/meteor/meteor/pull/9533) - ## v1.6.0.1, 2017-12-08 * Node has been upgraded to version From 7eaed1b43af51c3cbb7e951d43fd60240ed30155 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 2 Feb 2018 13:49:55 -0500 Subject: [PATCH 5/8] Add $v operator to fix issue #9623 --- packages/minimongo/local_collection.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/minimongo/local_collection.js b/packages/minimongo/local_collection.js index b414dcb3964..5ea83843e08 100644 --- a/packages/minimongo/local_collection.js +++ b/packages/minimongo/local_collection.js @@ -1848,6 +1848,12 @@ const MODIFIERS = { // native javascript numbers (doubles) so far, so we can't support $bit throw MinimongoError('$bit is not supported', {field}); }, + $v() { + // As discussed in https://github.com/meteor/meteor/issues/9623, + // the `$v` operator is not needed by Meteor, but problems can occur if + // it's not at least callable (as of Mongo >= 3.6). It's defined here as + // a no-op to work around these problems. + } }; const NO_CREATE_MODIFIERS = { From 9db6a437bca25e7ad6845c0da7647ae6222864c3 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Fri, 2 Feb 2018 13:54:11 -0500 Subject: [PATCH 6/8] Add PR link to History.md --- History.md | 1 + 1 file changed, 1 insertion(+) diff --git a/History.md b/History.md index c69ad9949ff..085d20041dd 100644 --- a/History.md +++ b/History.md @@ -108,6 +108,7 @@ * Mongo has been upgraded to version 3.6.2 for 64-bit OS', and 3.2.18 for 32-bit OS'. + [PR #9632](https://github.com/meteor/meteor/pull/9632) ## v1.6.1, 2018-01-19 From 57ef6e9cc45fdbb09c733c368b8eda69ccf134fd Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 1 Mar 2018 07:49:19 -0500 Subject: [PATCH 7/8] Add mention of db fix when jumping back to older versions --- History.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/History.md b/History.md index 085d20041dd..43767d9ab8b 100644 --- a/History.md +++ b/History.md @@ -67,6 +67,26 @@ `selftest.skip.define('some test', ...` will skip running "some test". [PR #9579](https://github.com/meteor/meteor/pull/9579) +* Mongo has been upgraded to version 3.6.2 for 64-bit OS', and 3.2.18 for + 32-bit OS'. + [PR #9632](https://github.com/meteor/meteor/pull/9632) + + **NOTE:** After upgrading an application to use Mongo 3.6.2, it has been + noticed ([#9591](https://github.com/meteor/meteor/issues/9591)) + that attempting to run that application with an older version of + Meteor (via `meteor --release X`), that uses an older version of Mongo, can + prevent the application from starting. This can be fixed by either + running `meteor reset`, or by repairing the Mongo database. To repair the + database, find the `mongod` binary on your system that lines up with the + Meteor release you're jumping back to, and run + `mongodb --dbpath your-apps-db --repair`. For example: + + ``` + /my-home/.meteor/packages/meteor-tool/1.6.0_1/mt-os.osx.x86_64/dev_bundle/mongodb/bin/mongod --dbpath /my-app/.meteor/local/db --repair + ``` + + [PR #9632](https://github.com/meteor/meteor/pull/9632) + * The `@babel/plugin-proposal-class-properties` plugin provided by `meteor-babel` now runs with the `loose:true` option, as required by other (optional) plugins like `@babel/plugin-proposal-decorators`. From 84e0d944dc7788d50783a9fa1a5eae4366dde440 Mon Sep 17 00:00:00 2001 From: Hugh Willson Date: Thu, 1 Mar 2018 07:56:11 -0500 Subject: [PATCH 8/8] Update to use latest Mongo 3.6.3 and 3.2.19 versions --- History.md | 4 ++-- scripts/admin/test-packages-with-mongo-versions.rb | 6 +++--- scripts/build-dev-bundle-common.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/History.md b/History.md index 43767d9ab8b..715c3f51376 100644 --- a/History.md +++ b/History.md @@ -67,12 +67,12 @@ `selftest.skip.define('some test', ...` will skip running "some test". [PR #9579](https://github.com/meteor/meteor/pull/9579) -* Mongo has been upgraded to version 3.6.2 for 64-bit OS', and 3.2.18 for +* Mongo has been upgraded to version 3.6.3 for 64-bit OS', and 3.2.19 for 32-bit OS'. [PR #9632](https://github.com/meteor/meteor/pull/9632) **NOTE:** After upgrading an application to use Mongo 3.6.2, it has been - noticed ([#9591](https://github.com/meteor/meteor/issues/9591)) + observed ([#9591](https://github.com/meteor/meteor/issues/9591)) that attempting to run that application with an older version of Meteor (via `meteor --release X`), that uses an older version of Mongo, can prevent the application from starting. This can be fixed by either diff --git a/scripts/admin/test-packages-with-mongo-versions.rb b/scripts/admin/test-packages-with-mongo-versions.rb index 7ebb703bdb2..807eaae342c 100755 --- a/scripts/admin/test-packages-with-mongo-versions.rb +++ b/scripts/admin/test-packages-with-mongo-versions.rb @@ -7,8 +7,8 @@ require 'tmpdir' mongo_install_urls = { - "3.6.2" => "https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-3.6.2.tgz", - "3.2.18" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.15.tgz", + "3.6.3" => "https://fastdl.mongodb.org/osx/mongodb-osx-ssl-x86_64-3.6.3.tgz", + "3.2.19" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.19.tgz", "3.0.5" => "https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.0.5.tgz", "2.6.10" => "http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.6.10.tgz" } @@ -29,7 +29,7 @@ test_env = "TEST_PACKAGES_EXCLUDE=\"less\"" -["3.6.2", "3.2.18", "3.0.5", "2.6.10"].each do |mongo_version| +["3.6.3", "3.2.19", "3.0.5", "2.6.10"].each do |mongo_version| puts "Installing and testing with Mongo #{mongo_version}..." Dir.mktmpdir "mongo_install" do |mongo_install_dir| diff --git a/scripts/build-dev-bundle-common.sh b/scripts/build-dev-bundle-common.sh index dc88380544c..b97c4690abd 100644 --- a/scripts/build-dev-bundle-common.sh +++ b/scripts/build-dev-bundle-common.sh @@ -6,8 +6,8 @@ set -u UNAME=$(uname) ARCH=$(uname -m) NODE_VERSION=8.9.4 -MONGO_VERSION_64BIT=3.6.2 -MONGO_VERSION_32BIT=3.2.18 +MONGO_VERSION_64BIT=3.6.3 +MONGO_VERSION_32BIT=3.2.19 NPM_VERSION=5.6.0 # If we built Node from source on Jenkins, this is the build number.