diff options
author | Dan Pasette <dan@mongodb.com> | 2017-09-21 11:58:18 -0400 |
---|---|---|
committer | Dan Pasette <dan@mongodb.com> | 2017-09-21 17:56:18 -0400 |
commit | d90e9a13a515a2c408b58ed0fad60a327ac7d3b7 (patch) | |
tree | 33e8b7fbaba565accf31bb5bcd1928581cd30a4c /src/mongo/db/commands/dbcommands.cpp | |
parent | 305f4366320ba2538f077c28d0f3ea6979277c48 (diff) | |
download | mongo-d90e9a13a515a2c408b58ed0fad60a327ac7d3b7.tar.gz |
Revert "Revert "SERVER-21677 Remove "diaglog" support from the server""
This reverts commit 0e3c8a96af7f9ddd6d5a059c92f6303eba1d0b32.
Fixed up rpm scripts to exclude mongosniff
Diffstat (limited to 'src/mongo/db/commands/dbcommands.cpp')
-rw-r--r-- | src/mongo/db/commands/dbcommands.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/mongo/db/commands/dbcommands.cpp b/src/mongo/db/commands/dbcommands.cpp index 791d851c376..15851760bc5 100644 --- a/src/mongo/db/commands/dbcommands.cpp +++ b/src/mongo/db/commands/dbcommands.cpp @@ -64,7 +64,6 @@ #include "mongo/db/db_raii.h" #include "mongo/db/dbdirectclient.h" #include "mongo/db/dbhelpers.h" -#include "mongo/db/diag_log.h" #include "mongo/db/exec/working_set_common.h" #include "mongo/db/index/index_access_method.h" #include "mongo/db/index/index_descriptor.h" @@ -391,64 +390,6 @@ public: } cmdProfile; -class CmdDiagLogging : public BasicCommand { -public: - virtual bool slaveOk() const { - return true; - } - CmdDiagLogging() : BasicCommand("diagLogging") {} - bool adminOnly() const { - return true; - } - - void help(stringstream& h) const { - h << "http://dochub.mongodb.org/core/" - "monitoring#MonitoringandDiagnostics-DatabaseRecord%2FReplay%28diagLoggingcommand%29"; - } - - - virtual bool supportsWriteConcern(const BSONObj& cmd) const override { - return false; - } - - virtual void addRequiredPrivileges(const std::string& dbname, - const BSONObj& cmdObj, - std::vector<Privilege>* out) { - ActionSet actions; - actions.addAction(ActionType::diagLogging); - out->push_back(Privilege(ResourcePattern::forClusterResource(), actions)); - } - - bool run(OperationContext* opCtx, - const string& dbname, - const BSONObj& cmdObj, - BSONObjBuilder& result) { - const char* deprecationWarning = - "CMD diagLogging is deprecated and will be removed in a future release"; - warning() << deprecationWarning << startupWarningsLog; - - // This doesn't look like it requires exclusive DB lock, because it uses its own diag - // locking, but originally the lock was set to be WRITE, so preserving the behaviour. - Lock::DBLock dbXLock(opCtx, dbname, MODE_X); - - // TODO (Kal): OldClientContext legacy, needs to be removed - { - CurOp::get(opCtx)->ensureStarted(); - stdx::lock_guard<Client> lk(*opCtx->getClient()); - CurOp::get(opCtx)->setNS_inlock(dbname); - } - - int was = _diaglog.setLevel(cmdObj.firstElement().numberInt()); - _diaglog.flush(); - if (!serverGlobalParams.quiet.load()) { - LOG(0) << "CMD: diagLogging set to " << _diaglog.getLevel() << " from: " << was; - } - result.append("was", was); - result.append("note", deprecationWarning); - return true; - } -} cmddiaglogging; - /* drop collection */ class CmdDrop : public ErrmsgCommandDeprecated { public: |