diff options
author | Louis Williams <louis.williams@mongodb.com> | 2017-09-07 11:31:37 -0400 |
---|---|---|
committer | Louis Williams <louis.williams@mongodb.com> | 2017-09-08 14:02:48 -0400 |
commit | b807dfe3c5e40526b2740fd83b106ce287edc4fe (patch) | |
tree | d70a155dd5b37f1d17082156130ea86b23b2704a /src/mongo | |
parent | 7c6374f5d5f94567f650eeef924058d88666d086 (diff) | |
download | mongo-b807dfe3c5e40526b2740fd83b106ce287edc4fe.tar.gz |
SERVER-30151 Accept oplog resize command in MB
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/db/commands/resize_oplog.cpp | 7 |
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 3323cfc996c..e8d34e251a9 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, @@ -107,8 +107,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")); } |