diff options
author | Reo Kimura <reo.kimura@mongodb.com> | 2022-10-13 20:52:49 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-27 18:25:52 +0000 |
commit | e1199f5b617f87d8dda296031a71f7b9d16dda2d (patch) | |
tree | 06256a6b75835af3fdcb107036e30d5550ddd263 | |
parent | 22d614d10977f3f505d70e984caf81fdd507de90 (diff) | |
download | mongo-e1199f5b617f87d8dda296031a71f7b9d16dda2d.tar.gz |
SERVER-69926 errorcodes.py doesn't detect duplicate errors in MONGO_UNREACHABLE_TASSERT
(cherry picked from commit 0d12c83b9b4c3aca1630fc6c41de2f17e4b09ab8)
12 files changed, 25 insertions, 23 deletions
diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py index 46e0ac09850..2bcf13ddd75 100755 --- a/buildscripts/errorcodes.py +++ b/buildscripts/errorcodes.py @@ -45,6 +45,7 @@ _CODE_PATTERNS = [ r"(?:StatusOK)?" r"(?:WithContext)?" r"\s*\(", + r"MONGO_UNREACHABLE_TASSERT\(", # DBException and AssertionException constructors r"(?:DB|Assertion)Exception\s*[({]", # Calls to all LOGV2* variants diff --git a/buildscripts/tests/data/errorcodes/regex_matching/regex_matching.cpp b/buildscripts/tests/data/errorcodes/regex_matching/regex_matching.cpp index b45042b4b0f..24b0b42fed3 100644 --- a/buildscripts/tests/data/errorcodes/regex_matching/regex_matching.cpp +++ b/buildscripts/tests/data/errorcodes/regex_matching/regex_matching.cpp @@ -32,3 +32,4 @@ iassert(27, "words"); iasserted(28, "words"); iassertNoTrace(29, "words"); iassertedNoTrace(30, "words"); +MONGO_UNREACHABLE_TASSERT(31); diff --git a/buildscripts/tests/test_errorcodes.py b/buildscripts/tests/test_errorcodes.py index d14aa505a92..17c102454b5 100644 --- a/buildscripts/tests/test_errorcodes.py +++ b/buildscripts/tests/test_errorcodes.py @@ -26,7 +26,7 @@ class TestErrorcodes(unittest.TestCase): captured_error_codes.append(code) errorcodes.parse_source_files(accumulate_files, TESTDATA_DIR + 'regex_matching/') - self.assertEqual(30, len(captured_error_codes)) + self.assertEqual(31, len(captured_error_codes)) def test_dup_checking(self): """Test dup checking.""" diff --git a/jstests/aggregation/sources/multiple_unpack_bucket_error.js b/jstests/aggregation/sources/multiple_unpack_bucket_error.js index 5c835b5e16e..3b5f20bf631 100644 --- a/jstests/aggregation/sources/multiple_unpack_bucket_error.js +++ b/jstests/aggregation/sources/multiple_unpack_bucket_error.js @@ -18,7 +18,7 @@ assert.commandFailedWithCode(db.runCommand({ ], cursor: {} }), - 5348302); + 5348304); // $_unpackBucket is an alias of $_internalUnpackBucket, the same restriction should apply. assert.commandFailedWithCode(db.runCommand({ @@ -29,7 +29,7 @@ assert.commandFailedWithCode(db.runCommand({ ], cursor: {} }), - 5348302); + 5348304); assert.commandFailedWithCode(db.runCommand({ aggregate: coll.getName(), pipeline: [ @@ -38,11 +38,11 @@ assert.commandFailedWithCode(db.runCommand({ ], cursor: {} }), - 5348302); + 5348304); assert.commandFailedWithCode(db.runCommand({ aggregate: coll.getName(), pipeline: [{$_unpackBucket: {timeField: 'time'}}, {$_unpackBucket: {timeField: 'time'}}], cursor: {} }), - 5348302); + 5348304); })(); diff --git a/jstests/aggregation/sources/setWindowFields/derivative.js b/jstests/aggregation/sources/setWindowFields/derivative.js index b457a1fa097..a57af814b30 100644 --- a/jstests/aggregation/sources/setWindowFields/derivative.js +++ b/jstests/aggregation/sources/setWindowFields/derivative.js @@ -192,9 +192,9 @@ function explainUnit(unit) { return coll.runCommand( {explain: {aggregate: coll.getName(), cursor: {}, pipeline: [derivativeStage(unit)]}}); } -assert.commandFailedWithCode(explainUnit('year'), 5490704); -assert.commandFailedWithCode(explainUnit('quarter'), 5490704); -assert.commandFailedWithCode(explainUnit('month'), 5490704); +assert.commandFailedWithCode(explainUnit('year'), 5490710); +assert.commandFailedWithCode(explainUnit('quarter'), 5490710); +assert.commandFailedWithCode(explainUnit('month'), 5490710); assert.commandWorked(explainUnit('week')); assert.commandWorked(explainUnit('day')); assert.commandWorked(explainUnit('hour')); diff --git a/jstests/aggregation/sources/setWindowFields/integral.js b/jstests/aggregation/sources/setWindowFields/integral.js index a62033e2b4f..bb0e962c504 100644 --- a/jstests/aggregation/sources/setWindowFields/integral.js +++ b/jstests/aggregation/sources/setWindowFields/integral.js @@ -115,9 +115,9 @@ function explainUnit(unit) { } }); } -assert.commandFailedWithCode(explainUnit('year'), 5490704); -assert.commandFailedWithCode(explainUnit('quarter'), 5490704); -assert.commandFailedWithCode(explainUnit('month'), 5490704); +assert.commandFailedWithCode(explainUnit('year'), 5490710); +assert.commandFailedWithCode(explainUnit('quarter'), 5490710); +assert.commandFailedWithCode(explainUnit('month'), 5490710); assert.commandWorked(explainUnit('week')); assert.commandWorked(explainUnit('day')); assert.commandWorked(explainUnit('hour')); diff --git a/src/mongo/db/pipeline/accumulator_sum.cpp b/src/mongo/db/pipeline/accumulator_sum.cpp index 63f1da7b94d..819f16bbf35 100644 --- a/src/mongo/db/pipeline/accumulator_sum.cpp +++ b/src/mongo/db/pipeline/accumulator_sum.cpp @@ -108,7 +108,7 @@ void AccumulatorSum::processInternal(const Value& input, bool merging) { applyPartialSum( input.getArray(), nonDecimalTotalType, totalType, nonDecimalTotal, decimalTotal); } else { - MONGO_UNREACHABLE_TASSERT(64227002); + MONGO_UNREACHABLE_TASSERT(6422702); } return; } diff --git a/src/mongo/db/pipeline/document_source.h b/src/mongo/db/pipeline/document_source.h index 98452e641ae..4618d913e81 100644 --- a/src/mongo/db/pipeline/document_source.h +++ b/src/mongo/db/pipeline/document_source.h @@ -647,7 +647,7 @@ public: return true; } // Cannot hit. - MONGO_UNREACHABLE_TASSERT(6434901); + MONGO_UNREACHABLE_TASSERT(6434902); } Type type; diff --git a/src/mongo/db/pipeline/lite_parsed_pipeline.cpp b/src/mongo/db/pipeline/lite_parsed_pipeline.cpp index 36b1d78d9b7..b7ca9c6310e 100644 --- a/src/mongo/db/pipeline/lite_parsed_pipeline.cpp +++ b/src/mongo/db/pipeline/lite_parsed_pipeline.cpp @@ -193,7 +193,7 @@ void LiteParsedPipeline::validate(const OperationContext* opCtx, // Validates that the pipeline contains at most one $_internalUnpackBucket or $_unpackBucket // stage. - uassert(5348302, + uassert(5348304, str::stream() << "Encountered pipeline with more than one " << DocumentSourceInternalUnpackBucket::kStageNameInternal << " or " << DocumentSourceInternalUnpackBucket::kStageNameExternal << " stage", diff --git a/src/mongo/db/pipeline/window_function/window_function_expression.h b/src/mongo/db/pipeline/window_function/window_function_expression.h index 2d6df6a69fb..8554963fd42 100644 --- a/src/mongo/db/pipeline/window_function/window_function_expression.h +++ b/src/mongo/db/pipeline/window_function/window_function_expression.h @@ -566,7 +566,7 @@ protected: case TimeUnit::year: case TimeUnit::quarter: case TimeUnit::month: - uasserted(5490704, "unit must be 'week' or smaller"); + uasserted(5490710, "unit must be 'week' or smaller"); // Only these time units are allowed. case TimeUnit::week: case TimeUnit::day: @@ -814,11 +814,11 @@ public: } boost::intrusive_ptr<AccumulatorState> buildAccumulatorOnly() const final { - MONGO_UNREACHABLE_TASSERT(5490701); + MONGO_UNREACHABLE_TASSERT(5490704); } std::unique_ptr<WindowFunctionState> buildRemovable() const final { - MONGO_UNREACHABLE_TASSERT(5490702); + MONGO_UNREACHABLE_TASSERT(5490705); } Value serialize(boost::optional<ExplainOptions::Verbosity> explain) const final { @@ -862,11 +862,11 @@ public: } boost::intrusive_ptr<AccumulatorState> buildAccumulatorOnly() const final { - MONGO_UNREACHABLE_TASSERT(5490701); + MONGO_UNREACHABLE_TASSERT(5490706); } std::unique_ptr<WindowFunctionState> buildRemovable() const final { - MONGO_UNREACHABLE_TASSERT(5490702); + MONGO_UNREACHABLE_TASSERT(5490707); } }; @@ -884,11 +884,11 @@ public: } boost::intrusive_ptr<AccumulatorState> buildAccumulatorOnly() const final { - MONGO_UNREACHABLE_TASSERT(5490701); + MONGO_UNREACHABLE_TASSERT(5490708); } std::unique_ptr<WindowFunctionState> buildRemovable() const final { - MONGO_UNREACHABLE_TASSERT(5490702); + MONGO_UNREACHABLE_TASSERT(5490709); } }; diff --git a/src/mongo/db/query/datetime/date_time_support.cpp b/src/mongo/db/query/datetime/date_time_support.cpp index c17d44dcf1f..39b11bc1efe 100644 --- a/src/mongo/db/query/datetime/date_time_support.cpp +++ b/src/mongo/db/query/datetime/date_time_support.cpp @@ -853,7 +853,7 @@ StringData serializeTimeUnit(TimeUnit unit) { case TimeUnit::millisecond: return "millisecond"_sd; } - MONGO_UNREACHABLE_TASSERT(5339900); + MONGO_UNREACHABLE_TASSERT(5339903); } DayOfWeek parseDayOfWeek(StringData dayOfWeek) { diff --git a/src/mongo/s/commands/cluster_map_reduce_agg.cpp b/src/mongo/s/commands/cluster_map_reduce_agg.cpp index 30dab6b1238..0fc9386a839 100644 --- a/src/mongo/s/commands/cluster_map_reduce_agg.cpp +++ b/src/mongo/s/commands/cluster_map_reduce_agg.cpp @@ -243,7 +243,7 @@ bool runAggregationMapReduce(OperationContext* opCtx, case cluster_aggregation_planner::AggregationTargeter::TargetingPolicy:: kSpecificShardOnly: { // It should not be possible to pass $_passthroughToShard to a map reduce command. - MONGO_UNREACHABLE_TASSERT(6273803); + MONGO_UNREACHABLE_TASSERT(6273805); } } } catch (DBException& e) { |