summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2015-03-13 14:37:04 -0400
committerRandolph Tan <randolph@10gen.com>2015-03-13 14:37:04 -0400
commit7f73e3e38f9b606574a2b7599e0b0f491b962587 (patch)
tree917b99278917de9c9e91622a7027b35c695a7c34
parent40502abaac233ed0b27a9bf9612bd4df61811a68 (diff)
downloadmongo-7f73e3e38f9b606574a2b7599e0b0f491b962587.tar.gz
SERVER-16987 sh.getRecentMigrations shows aborted migration as success
Add more comments
-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: {