diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2019-11-18 17:46:25 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-02 18:10:46 +0000 |
commit | 2606b8fd4a045a27acc7d57f08d5fc6f51d31296 (patch) | |
tree | b80afb1af9794a206bdfe6b97ce620c489b925ad /src/mongo/db/sorter | |
parent | 5a3dd86b2e06a065ba435e4a6fe69300d0ba73a0 (diff) | |
download | mongo-2606b8fd4a045a27acc7d57f08d5fc6f51d31296.tar.gz |
SERVER-46109 Adopt QueryExceededMemoryLimitNoDiskUseAllowed error code
Diffstat (limited to 'src/mongo/db/sorter')
-rw-r--r-- | src/mongo/db/sorter/sorter.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index 41675b140df..aa387dcb944 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -595,11 +595,11 @@ private: return; 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, + // This error message only applies to sorts from user queries made through the find or + // aggregation commands. Other clients, such as bulk index builds, should suppress this + // error, either by allowing external sorting or by catching and throwing a more + // appropriate error. + uasserted(ErrorCodes::QueryExceededMemoryLimitNoDiskUseAllowed, str::stream() << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes << " bytes, but did not opt in to external sorting."); } @@ -880,11 +880,10 @@ private: return; 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, + // This error message only applies to sorts from user queries made through the find or + // aggregation commands. Other clients should suppress this error, either by allowing + // external sorting or by catching and throwing a more appropriate error. + uasserted(ErrorCodes::QueryExceededMemoryLimitNoDiskUseAllowed, str::stream() << "Sort exceeded memory limit of " << _opts.maxMemoryUsageBytes << " bytes, but did not opt in to external sorting. Aborting operation." |