Improve primary detection mechanism to be compatible with older mongodb instances

Generate 2.6 beta 2
This commit is contained in:
Renan Castro
2022-01-07 13:40:27 -03:00
committed by Filipe Névola
parent c8eb086116
commit c4d4ea2a09
8 changed files with 13 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
Package.describe({
name: 'allow-deny',
version: '1.1.1-beta260.1',
version: '1.1.1-beta260.2',
// Brief, one-line summary of the package.
summary: 'Implements functionality for allow/deny and client-side db operations',
// URL to the Git repository containing the source code for this package.

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: 'The Meteor command-line tool',
version: '2.6.0-beta.1',
version: '2.6.0-beta.2',
});
Package.includeTool();

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Meteor's client-side datastore: a port of MongoDB to Javascript",
version: '1.8.0-beta260.1'
version: '1.8.0-beta260.2'
});
Package.onUse(api => {

View File

@@ -195,12 +195,15 @@ MongoConnection = function (url, options) {
try {
const helloDocument = db.admin().command({hello: 1}).await();
// First, figure out what the current primary is, if any.
if (helloDocument.isWritablePrimary) {
if (helloDocument.primary) {
self._primary = helloDocument.primary;
}
}catch(_){
if (db.serverConfig && db.serverConfig.isMasterDoc) {
self._primary = db.serverConfig.isMasterDoc.primary;
// ismaster command is supported on older mongodb versions
const isMasterDocument = db.admin().command({ismaster:1}).await();
// First, figure out what the current primary is, if any.
if (isMasterDocument.primary) {
self._primary = isMasterDocument.primary;
}
}

View File

@@ -9,7 +9,7 @@
Package.describe({
summary: "Adaptor for using MongoDB and Minimongo over DDP",
version: '1.14.0-beta260.1'
version: '1.14.0-beta260.2'
});
Npm.depends({

View File

@@ -3,7 +3,7 @@
Package.describe({
summary: "Wrapper around the mongo npm package",
version: "4.3.0-beta260.1",
version: "4.3.0-beta260.2",
documentation: null
});

View File

@@ -1,6 +1,6 @@
Package.describe({
summary: "Tiny testing framework",
version: '1.2.1-beta260.1'
version: '1.2.1-beta260.2'
});
Package.onUse(function (api) {

View File

@@ -1,6 +1,6 @@
{
"track": "METEOR",
"version": "2.6-beta.1",
"version": "2.6-beta.2",
"recommended": false,
"official": false,
"description": "Meteor experimental release"