diff options
author | Randolph Tan <randolph@10gen.com> | 2014-12-19 13:22:41 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2014-12-22 15:31:46 -0500 |
commit | bf0cdcee577aa5a05ba65506d8bd47f33eac30d2 (patch) | |
tree | d67138584e3d65153ac2e0e5684f48ae5cd88b41 | |
parent | 1921c8c3f1cdaf0eebec76d328bc773018594bdf (diff) | |
download | mongo-bf0cdcee577aa5a05ba65506d8bd47f33eac30d2.tar.gz |
SERVER-15798 Helpers::removeRange does not check if node is primary
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index e6258c23a2c..7c21615f3d6 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -446,6 +446,14 @@ namespace mongo { break; } } + + if (!repl::getGlobalReplicationCoordinator()->canAcceptWritesForDatabase(ns)) { + warning() << "stepped down from primary while deleting chunk; " + << "orphaning data in " << ns + << " in range [" << min << ", " << max << ")"; + return numDeleted; + } + if ( callback ) callback->goingToDelete( obj ); |