summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-03-13 14:37:04 -0400
committerRamon Fernandez <ramon.fernandez@mongodb.com>2015-04-20 15:01:53 -0400
commitd12a68e550e4f928b8c8f9d052062b4072b236ef (patch)
treee06f721a165eddce378b380f520f51e6786f674e
parent6920a654e8bc81b602a39bb96216ba44ad7da53f (diff)
downloadmongo-d12a68e550e4f928b8c8f9d052062b4072b236ef.tar.gz
SERVER-16987 sh.getRecentMigrations shows aborted migration as success
Add more comments (cherry picked from commit 7f73e3e38f9b606574a2b7599e0b0f491b962587)
-rw-r--r--src/mongo/shell/utils_sh.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/shell/utils_sh.js b/src/mongo/shell/utils_sh.js
index 69ad01666b8..88f3abeb4ee 100644
--- a/src/mongo/shell/utils_sh.js
+++ b/src/mongo/shell/utils_sh.js
@@ -430,9 +430,16 @@ sh.getRecentFailedRounds = function() {
return result;
}
+/**
+ * Returns a summary of chunk migrations that was completed either successfully or not
+ * since yesterday. The format is an array of 2 arrays, where the first array contains
+ * the successful cases, and the second array contains the failure cases.
+ */
sh.getRecentMigrations = function() {
var configDB = db.getSiblingDB('config');
var yesterday = new Date( new Date() - 24 * 60 * 60 * 1000 );
+
+ // Successful migrations.
var result = configDB.changelog.aggregate([
{
$match: {
@@ -458,6 +465,7 @@ sh.getRecentMigrations = function() {
}
]).toArray();
+ // Failed migrations.
result = result.concat(configDB.changelog.aggregate([
{
$match: {