diff options
Diffstat (limited to 'src/mongo/db/commands/compact.cpp')
-rw-r--r-- | src/mongo/db/commands/compact.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index 4e51b92e930..a9384134c3a 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -35,21 +35,19 @@ #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/privilege.h" #include "mongo/db/background.h" -#include "mongo/db/commands.h" +#include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" -#include "mongo/db/d_concurrency.h" +#include "mongo/db/commands.h" #include "mongo/db/curop.h" +#include "mongo/db/d_concurrency.h" #include "mongo/db/index_builder.h" #include "mongo/db/jsobj.h" #include "mongo/db/kill_current_op.h" -#include "mongo/db/catalog/collection.h" #include "mongo/db/operation_context_impl.h" +#include "mongo/db/repl/rs.h" namespace mongo { - // from repl/rs.cpp - bool isCurrentlyAReplSetPrimary(); - class CompactCmd : public Command { public: virtual bool isWriteCommandForConfigServer() const { return false; } @@ -90,7 +88,7 @@ namespace mongo { return false; } - if( isCurrentlyAReplSetPrimary() && !cmdObj["force"].trueValue() ) { + if (replset::isCurrentlyAReplSetPrimary() && !cmdObj["force"].trueValue()) { errmsg = "will not run compact on an active replica set primary as this is a slow blocking operation. use force:true to force"; return false; } |