From 7f73e3e38f9b606574a2b7599e0b0f491b962587 Mon Sep 17 00:00:00 2001 From: Randolph Tan Date: Fri, 13 Mar 2015 14:37:04 -0400 Subject: SERVER-16987 sh.getRecentMigrations shows aborted migration as success Add more comments --- src/mongo/shell/utils_sh.js | 8 ++++++++ 1 file changed, 8 insertions(+) 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: { -- cgit v1.2.1