diff options
author | Mathias Stearn <mathias@10gen.com> | 2014-01-29 14:32:59 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2014-01-29 18:28:47 -0500 |
commit | 242b2247bdff32b536aaad36d92f963e4f8c959c (patch) | |
tree | c29da409e5e203ef1c82550c158c842c70591049 /src/mongo/db | |
parent | 791d6d40fc94eaa7264bce319aab94d98d20df4c (diff) | |
download | mongo-242b2247bdff32b536aaad36d92f963e4f8c959c.tar.gz |
SERVER-11239 Rename flag to allowDiskUse and include in error messages
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/commands/pipeline_command.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/pipeline/document_source_group.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/pipeline/pipeline.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/sorter/sorter.cpp | 20 |
4 files changed, 22 insertions, 9 deletions
diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index 47fc9ecaa18..7a024de270d 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -278,7 +278,7 @@ namespace { virtual void help(stringstream &help) const { help << "{ pipeline: [ { $operator: {...}}, ... ]" << ", explain: <bool>" - << ", allowDiskUsage: <bool>" + << ", allowDiskUse: <bool>" << ", cursor: {batchSize: <number>}" << " }" << endl diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp index b5350f61fa5..30ea3d1504e 100644 --- a/src/mongo/db/pipeline/document_source_group.cpp +++ b/src/mongo/db/pipeline/document_source_group.cpp @@ -362,7 +362,8 @@ namespace mongo { // This loop consumes all input from pSource and buckets it based on pIdExpression. while (boost::optional<Document> input = pSource->getNext()) { if (memoryUsageBytes > _maxMemoryUsageBytes) { - uassert(16945, "Exceeded memory limit for $group, but didn't allow external sort", + uassert(16945, "Exceeded memory limit for $group, but didn't allow external sort." + " Pass allowDiskUse:true to opt in.", _extSortAllowed); sortedFiles.push_back(spill()); memoryUsageBytes = 0; diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index 5daa8b3df3b..65be93fd587 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -147,9 +147,9 @@ namespace mongo { continue; } - if (str::equals(pFieldName, "allowDiskUsage")) { + if (str::equals(pFieldName, "allowDiskUse")) { uassert(16949, - str::stream() << "allowDiskUsage must be a bool, not a " + str::stream() << "allowDiskUse must be a bool, not a " << typeName(cmdElement.type()), cmdElement.type() == Bool); pCtx->extSortAllowed = cmdElement.Bool(); @@ -468,7 +468,7 @@ namespace mongo { } if (pCtx->extSortAllowed) { - serialized.setField("allowDiskUsage", Value(true)); + serialized.setField("allowDiskUse", Value(true)); } return serialized.freeze(); diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index 3539e07984c..c2a39a1e0b2 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -448,11 +448,17 @@ namespace mongo { if (_data.empty()) return; - if (!_opts.extSortAllowed) + if (!_opts.extSortAllowed) { + // XXX This error message is only correct for aggregation, but it is also the + // only way this code could be hit at the moment. If the Sorter is used + // elsewhere where extSortAllowed could possibly be false, this message will + // need to be revisited. uasserted(16819, str::stream() << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes - << " bytes, but did not opt-in to external sorting. Aborting operation." + << " bytes, but did not opt in to external sorting. Aborting operation." + << " Pass allowDiskUse:true to opt in." ); + } sort(); @@ -713,11 +719,17 @@ namespace mongo { if (_data.empty()) return; - if (!_opts.extSortAllowed) + if (!_opts.extSortAllowed) { + // XXX This error message is only correct for aggregation, but it is also the + // only way this code could be hit at the moment. If the Sorter is used + // elsewhere where extSortAllowed could possibly be false, this message will + // need to be revisited. uasserted(16820, str::stream() << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes - << " bytes, but did not opt-in to external sorting. Aborting operation." + << " bytes, but did not opt in to external sorting. Aborting operation." + << " Pass allowDiskUse:true to opt in." ); + } sort(); updateCutoff(); |