diff options
author | Spencer T Brody <spencer@mongodb.com> | 2015-09-30 14:32:46 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2015-10-07 12:50:51 -0400 |
commit | 0cf1be838e229b4385ac4313e994040a230857e5 (patch) | |
tree | 5236f89d7410122cee8a99a7ee232554203673f6 /src/mongo/s/d_split.cpp | |
parent | 60b2e7ffce5f91093d39c6d80701aa3f7c36b5c3 (diff) | |
download | mongo-0cf1be838e229b4385ac4313e994040a230857e5.tar.gz |
SERVER-20700 Sort split keys returned by splitVector
Diffstat (limited to 'src/mongo/s/d_split.cpp')
-rw-r--r-- | src/mongo/s/d_split.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/s/d_split.cpp b/src/mongo/s/d_split.cpp index 16eec736bfa..0a7c367b2ca 100644 --- a/src/mongo/s/d_split.cpp +++ b/src/mongo/s/d_split.cpp @@ -30,6 +30,7 @@ #include "mongo/platform/basic.h" +#include <algorithm> #include <map> #include <string> #include <vector> @@ -508,6 +509,10 @@ public: result.append("timeMillis", timer.millis()); } + // Make sure splitKeys is in ascending order + std::sort(splitKeys.begin(), + splitKeys.end(), + [](const BSONObj& lhs, const BSONObj& rhs) -> bool { return lhs < rhs; }); result.append("splitKeys", splitKeys); return true; } |