diff options
author | David Storch <david.storch@mongodb.com> | 2019-10-02 00:34:39 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-02 00:34:39 +0000 |
commit | 62f03390c9957eba4c250eb3893b873391add3d2 (patch) | |
tree | 753b00697862dbc3526a482681903ef43e90eb5c /src/mongo/db/query/query_request_test.cpp | |
parent | 6adefc73b4990253e4f277b49b119db1a05b7490 (diff) | |
download | mongo-62f03390c9957eba4c250eb3893b873391add3d2.tar.gz |
SERVER-7694 Enable allowing disk use for sorts in the find command.
For find commands that request a sort, the query execution
engine can now spill data to disk if the memory requirements
would exceed 'internalQueryExecBlockingSortBytes' and the
'allowDiskUse' parameter is set to true. By default, the
memory threshold is currently 100MB. This allows
applications which need to sort server-side to no longer be
subject to an arbitrary data size threshold.
Diffstat (limited to 'src/mongo/db/query/query_request_test.cpp')
-rw-r--r-- | src/mongo/db/query/query_request_test.cpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/mongo/db/query/query_request_test.cpp b/src/mongo/db/query/query_request_test.cpp index c2624e65ceb..4c6a5cd2f41 100644 --- a/src/mongo/db/query/query_request_test.cpp +++ b/src/mongo/db/query/query_request_test.cpp @@ -35,7 +35,6 @@ #include "mongo/db/catalog/collection_catalog.h" #include "mongo/db/catalog/collection_mock.h" -#include "mongo/db/commands/test_commands_enabled.h" #include "mongo/db/dbmessage.h" #include "mongo/db/json.h" #include "mongo/db/namespace_string.h" @@ -1082,10 +1081,6 @@ TEST(QueryRequestTest, DefaultQueryParametersCorrect) { } TEST(QueryRequestTest, ParseCommandAllowDiskUseTrue) { - const bool oldTestCommandsEnabledVal = getTestCommandsEnabled(); - ON_BLOCK_EXIT([&] { setTestCommandsEnabled(oldTestCommandsEnabledVal); }); - setTestCommandsEnabled(true); - BSONObj cmdObj = fromjson("{find: 'testns', allowDiskUse: true}"); const NamespaceString nss("test.testns"); const bool isExplain = false; @@ -1096,10 +1091,6 @@ TEST(QueryRequestTest, ParseCommandAllowDiskUseTrue) { } TEST(QueryRequestTest, ParseCommandAllowDiskUseFalse) { - const bool oldTestCommandsEnabledVal = getTestCommandsEnabled(); - ON_BLOCK_EXIT([&] { setTestCommandsEnabled(oldTestCommandsEnabledVal); }); - setTestCommandsEnabled(true); - BSONObj cmdObj = fromjson("{find: 'testns', allowDiskUse: false}"); const NamespaceString nss("test.testns"); const bool isExplain = false; @@ -1109,22 +1100,6 @@ TEST(QueryRequestTest, ParseCommandAllowDiskUseFalse) { ASSERT_EQ(false, result.getValue()->allowDiskUse()); } -TEST(QueryRequestTest, ParseCommandAllowDiskUseTestCommandsDisabled) { - const bool oldTestCommandsEnabledVal = getTestCommandsEnabled(); - ON_BLOCK_EXIT([&] { setTestCommandsEnabled(oldTestCommandsEnabledVal); }); - setTestCommandsEnabled(false); - - BSONObj cmdObj = fromjson("{find: 'testns', allowDiskUse: true}"); - const NamespaceString nss("test.testns"); - const bool isExplain = false; - auto result = QueryRequest::makeFromFindCommand(nss, cmdObj, isExplain); - - ASSERT_NOT_OK(result.getStatus()); - ASSERT_EQ(ErrorCodes::FailedToParse, result.getStatus().code()); - ASSERT_STRING_CONTAINS(result.getStatus().toString(), - "allowDiskUse is not allowed unless test commands are enabled."); -} - // // Extra fields cause the parse to fail. // |