summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-02-23 10:55:06 -0500
committerRandolph Tan <randolph@10gen.com>2015-03-17 13:39:15 -0400
commitdb982c182c5c0acb2cd08ecdfc2a10c66712d7cd (patch)
treebbfa5a71cac682df11de180c478c6857f3da3d55 /src
parent010b40a018a909a4785fdd312bc49f8977f7e2ea (diff)
downloadmongo-db982c182c5c0acb2cd08ecdfc2a10c66712d7cd.tar.gz
SERVER-17348 Bump mongos upgrade version for v3.2
Diffstat (limited to 'src')
-rw-r--r--src/mongo/s/SConscript4
-rw-r--r--src/mongo/s/config_upgrade.cpp12
-rw-r--r--src/mongo/s/config_upgrade.h12
-rw-r--r--src/mongo/s/config_upgrade_v0_to_v7.cpp (renamed from src/mongo/s/config_upgrade_v0_to_v6.cpp)4
-rw-r--r--src/mongo/s/config_upgrade_v6_to_v7.cpp (renamed from src/mongo/s/config_upgrade_v5_to_v6.cpp)103
-rw-r--r--src/mongo/shell/replsettest.js3
-rwxr-xr-xsrc/mongo/shell/servers.js12
7 files changed, 29 insertions, 121 deletions
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index 44b0122da47..3581b6f6e55 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -83,8 +83,8 @@ env.CppUnitTest('type_tags_test', 'type_tags_test.cpp',
env.Library('upgrade', ['cluster_client_internal.cpp',
'config_upgrade.cpp',
'config_upgrade_helpers.cpp',
- 'config_upgrade_v0_to_v6.cpp',
- 'config_upgrade_v5_to_v6.cpp'],
+ 'config_upgrade_v0_to_v7.cpp',
+ 'config_upgrade_v6_to_v7.cpp'],
LIBDEPS=['base',
'$BUILD_DIR/mongo/mongocommon'])
diff --git a/src/mongo/s/config_upgrade.cpp b/src/mongo/s/config_upgrade.cpp
index 58e0a239d0d..b1efaa8bb39 100644
--- a/src/mongo/s/config_upgrade.cpp
+++ b/src/mongo/s/config_upgrade.cpp
@@ -128,13 +128,13 @@ namespace mongo {
ConfigUpgradeRegistry registry;
- // v0 to v6
- Upgrade v0ToV6(0, VersionRange(5, 6), doUpgradeV0ToV6);
- registry.insert(make_pair(v0ToV6.fromVersion, v0ToV6));
+ // v0 to v7
+ Upgrade v0ToV7(0, VersionRange(6, 7), doUpgradeV0ToV7);
+ registry.insert(make_pair(v0ToV7.fromVersion, v0ToV7));
- // v5 to v6
- Upgrade v5ToV6(5, VersionRange(5, 6), doUpgradeV5ToV6);
- registry.insert(make_pair(v5ToV6.fromVersion, v5ToV6));
+ // v6 to v7
+ Upgrade v6ToV7(6, VersionRange(6, 7), doUpgradeV6ToV7);
+ registry.insert(make_pair(v6ToV7.fromVersion, v6ToV7));
validateRegistry(registry);
diff --git a/src/mongo/s/config_upgrade.h b/src/mongo/s/config_upgrade.h
index 70c542305fe..65253377ac3 100644
--- a/src/mongo/s/config_upgrade.h
+++ b/src/mongo/s/config_upgrade.h
@@ -113,7 +113,9 @@ namespace mongo {
* specifications.
* + config.locks { ts: 1 } index is no longer unique.
*/
- UpgradeHistory_DummyBumpPre2_8 = 6,
+ UpgradeHistory_DummyBumpPre2_8 = 6, // Note: 2.8 is also known as 3.0.
+
+ UpgradeHistory_DummyBumpPre3_0 = 7,
};
//
@@ -122,10 +124,10 @@ namespace mongo {
//
// Earliest version we're compatible with
- const int MIN_COMPATIBLE_CONFIG_VERSION = UpgradeHistory_DummyBumpPre2_6;
+ const int MIN_COMPATIBLE_CONFIG_VERSION = UpgradeHistory_DummyBumpPre2_8;
// Latest version we know how to communicate with
- const int CURRENT_CONFIG_VERSION = UpgradeHistory_DummyBumpPre2_8;
+ const int CURRENT_CONFIG_VERSION = UpgradeHistory_DummyBumpPre3_0;
//
// DECLARATION OF UPGRADE FUNCTIONALITY
@@ -133,11 +135,11 @@ namespace mongo {
// config_upgrade.cpp::createRegistry()
//
- bool doUpgradeV0ToV6(const ConnectionString& configLoc,
+ bool doUpgradeV0ToV7(const ConnectionString& configLoc,
const VersionType& lastVersionInfo,
std::string* errMsg);
- bool doUpgradeV5ToV6(const ConnectionString& configLoc,
+ bool doUpgradeV6ToV7(const ConnectionString& configLoc,
const VersionType& lastVersionInfo,
std::string* errMsg);
diff --git a/src/mongo/s/config_upgrade_v0_to_v6.cpp b/src/mongo/s/config_upgrade_v0_to_v7.cpp
index f9011b41cea..9fff7462fd3 100644
--- a/src/mongo/s/config_upgrade_v0_to_v6.cpp
+++ b/src/mongo/s/config_upgrade_v0_to_v7.cpp
@@ -46,11 +46,11 @@ namespace mongo {
using mongo::str::stream;
/**
- * Upgrade v0 to v6 described here
+ * Upgrade v0 to v7 described here
*
* This upgrade takes the config server from empty to an initial version.
*/
- bool doUpgradeV0ToV6(const ConnectionString& configLoc,
+ bool doUpgradeV0ToV7(const ConnectionString& configLoc,
const VersionType& lastVersionInfo,
string* errMsg)
{
diff --git a/src/mongo/s/config_upgrade_v5_to_v6.cpp b/src/mongo/s/config_upgrade_v6_to_v7.cpp
index 52ec6e43f5b..e2049cda647 100644
--- a/src/mongo/s/config_upgrade_v5_to_v6.cpp
+++ b/src/mongo/s/config_upgrade_v6_to_v7.cpp
@@ -44,70 +44,27 @@ namespace mongo {
using std::string;
using std::vector;
- static const char* minMongoProcessVersion = "2.6";
+ static const char* minMongoProcessVersion = "3.0";
static const char* cannotCleanupMessage =
"\n\n"
"******\n"
- "Cannot upgrade config database from v5 to v6 because a previous upgrade\n"
+ "Cannot upgrade config database from v6 to v7 because a previous upgrade\n"
"failed in the critical section. Manual intervention is required to re-sync\n"
"the config servers.\n"
"******\n";
- namespace {
- /**
- * Returns false if the { ts: 1 } unique index does not exist. Returns true if it does
- * or cannot confirm that it does due to errors.
- */
- bool hasBadIndex(const ConnectionString& configLoc,
- string* errMsg) {
- const BSONObj lockIdxKey = BSON(LocksType::lockID() << 1);
- const NamespaceString indexNS(LocksType::ConfigNS);
-
- vector<HostAndPort> configHosts = configLoc.getServers();
- for (vector<HostAndPort>::const_iterator configIter = configHosts.begin();
- configIter != configHosts.end(); ++configIter) {
-
- list<BSONObj> indexSpecs;
- try {
- ScopedDbConnection conn(*configIter);
- indexSpecs = conn->getIndexSpecs(indexNS);
- conn.done();
- }
- catch (const DBException& ex) {
- *errMsg = str::stream() << "error while checking { ts: 1 } index"
- << causedBy(ex);
- return true;
- }
-
- for (list<BSONObj>::const_iterator idxIter = indexSpecs.begin();
- idxIter != indexSpecs.end(); ++idxIter) {
- BSONObj indexSpec(*idxIter);
- if (indexSpec["key"].Obj().woCompare(lockIdxKey) == 0) {
- if (indexSpec["unique"].trueValue()) {
- *errMsg = str::stream() << "unique { ts: 1 } index still exists in "
- << configIter->toString();
- return true;
- }
- }
- }
- }
-
- return false;
- }
- }
-
/**
- * Upgrades v5 to v6.
+ * Upgrades v6 to v7.
*/
- bool doUpgradeV5ToV6(const ConnectionString& configLoc,
+ bool doUpgradeV6ToV7(const ConnectionString& configLoc,
const VersionType& lastVersionInfo,
string* errMsg)
{
string dummy;
if (!errMsg) errMsg = &dummy;
- verify(lastVersionInfo.getCurrentVersion() == UpgradeHistory_DummyBumpPre2_6);
+ verify(lastVersionInfo.getCurrentVersion() == UpgradeHistory_DummyBumpPre2_8);
Status result = preUpgradeCheck(configLoc, lastVersionInfo, minMongoProcessVersion);
if (!result.isOK()) {
@@ -139,56 +96,6 @@ namespace mongo {
// 6. Rename the backup collection to the name of the original collection with
// dropTarget set to true.
- // Make sure the { ts: 1 } index is not unique by dropping the existing one
- // and rebuilding the index with the right specification.
-
- const BSONObj lockIdxKey = BSON(LocksType::lockID() << 1);
- const NamespaceString indexNS(LocksType::ConfigNS);
-
- bool dropOk = false;
- try {
- ScopedDbConnection conn(configLoc);
- BSONObj dropResponse;
- dropOk = conn->runCommand(indexNS.db().toString(),
- BSON("dropIndexes" << indexNS.coll()
- << "index" << lockIdxKey),
- dropResponse);
- conn.done();
- }
- catch (const DBException& ex) {
- if (ex.getCode() == 13105) {
- // 13105 is the exception code from SyncClusterConnection::findOne that gets
- // thrown when one of the command responses has an "ok" field that is not true.
- dropOk = false;
- }
- else {
- *errMsg = str::stream() << "Failed to drop { ts: 1 } index" << causedBy(ex);
- return false;
- }
- }
-
- if (!dropOk && hasBadIndex(configLoc, errMsg)) {
- // Fail only if the index still exists.
- return false;
- }
-
- result = clusterCreateIndex(LocksType::ConfigNS,
- BSON(LocksType::lockID() << 1),
- false, // unique
- NULL);
-
- if (!result.isOK()) {
- *errMsg = str::stream() << "error while creating { ts: 1 } index on config db"
- << causedBy(result);
- return false;
- }
-
- LOG(1) << "Checking to make sure that the right { ts: 1 } index is created...";
-
- if (hasBadIndex(configLoc, errMsg)) {
- return false;
- }
-
// We're only after the version bump in commitConfigUpgrade here since we never
// get into the critical section.
Status commitStatus = commitConfigUpgrade(configLoc.toString(),
diff --git a/src/mongo/shell/replsettest.js b/src/mongo/shell/replsettest.js
index ab3abc62019..f3a923b95b0 100644
--- a/src/mongo/shell/replsettest.js
+++ b/src/mongo/shell/replsettest.js
@@ -979,7 +979,7 @@ ReplSetTest.prototype.waitForIndicator = function( node, states, ind, timeout ){
var lastTime = null
var currTime = new Date().getTime()
- var status = undefined
+ var status = undefined;
var self = this;
assert.soon(function() {
@@ -988,7 +988,6 @@ ReplSetTest.prototype.waitForIndicator = function( node, states, ind, timeout ){
if (!conn) conn = self.liveNodes.slaves[0];
if (!conn) return false; // Try again to load connection
- var status = null;
var getStatusFunc = function() {
status = conn.getDB('admin').runCommand({replSetGetStatus: 1});
};
diff --git a/src/mongo/shell/servers.js b/src/mongo/shell/servers.js
index c37035c27c4..a4978dc97b2 100755
--- a/src/mongo/shell/servers.js
+++ b/src/mongo/shell/servers.js
@@ -112,14 +112,14 @@ MongoRunner.VersionSub = function(regex, version) {
// version string to support the dev/stable MongoDB release cycle.
MongoRunner.binVersionSubs = [ new MongoRunner.VersionSub(/^latest$/, ""),
new MongoRunner.VersionSub(/^oldest-supported$/, "1.8"),
- // To-be-updated when 3.0 becomes available
- new MongoRunner.VersionSub(/^last-stable$/, "2.6"),
+ // To-be-updated when 3.4 becomes available
+ new MongoRunner.VersionSub(/^last-stable$/, "3.0"),
// Latest unstable and next stable are effectively the
// same release
- new MongoRunner.VersionSub(/^2\.7(\..*){0,1}/, ""),
- new MongoRunner.VersionSub(/^2\.8(\..*){0,1}/, ""),
- new MongoRunner.VersionSub(/^3\.0(\..*){0,1}/, ""),
- new MongoRunner.VersionSub(/^3\.1(\..*){0,1}/, "") ];
+ // 2.8 and 3.0 are equivalent.
+ new MongoRunner.VersionSub(/^2\.8(\..*){0,1}/, "3.0"),
+ new MongoRunner.VersionSub(/^3\.1(\..*){0,1}/, ""),
+ new MongoRunner.VersionSub(/^3\.2(\..*){0,1}/, "") ];
MongoRunner.getBinVersionFor = function(version) {