summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2017-09-07 11:31:37 -0400
committerEric Milkie <milkie@10gen.com>2018-12-07 08:26:28 -0500
commit79607f92debdeb3841387ff368f37764c23b913f (patch)
treeee5e63f101545f164d7b7851dd92deb4cea0e1b3
parent0802b5f4033e481cc3c2830d6f14a3fdd5b3ffcd (diff)
downloadmongo-79607f92debdeb3841387ff368f37764c23b913f.tar.gz
SERVER-30151 Accept oplog resize command in MB
(cherry picked from commit b807dfe3c5e40526b2740fd83b106ce287edc4fe)
-rw-r--r--src/mongo/db/commands/resize_oplog.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/commands/resize_oplog.cpp b/src/mongo/db/commands/resize_oplog.cpp
index e77f140bb04..ea2899ed62a 100644
--- a/src/mongo/db/commands/resize_oplog.cpp
+++ b/src/mongo/db/commands/resize_oplog.cpp
@@ -67,7 +67,7 @@ public:
}
virtual void help(stringstream& help) const {
- help << "resize oplog size";
+ help << "resize oplog size in MB";
}
Status checkAuthForCommand(Client* client,
@@ -109,8 +109,9 @@ public:
Status(ErrorCodes::InvalidOptions, "invalid size field, size should be a number"));
}
- long long size = jsobj["size"].numberLong();
- if (size < 990LL * 1024 * 1024) {
+ long long sizeMb = jsobj["size"].numberLong();
+ long long size = sizeMb * 1024 * 1024;
+ if (sizeMb < 990L) {
return appendCommandStatus(
result, Status(ErrorCodes::InvalidOptions, "oplog size should be 990MB at least"));
}