[SERVER-56046] [SBE][sharding] error_propagation.js fails with the wrong error code Created: 12/Apr/21  Updated: 29/Oct/23  Resolved: 13/Apr/21

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Kyle Suarez Assignee: Eric Cox (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-55010 Enable sharding suite against SBE bui... Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-04-19
Participants:

 Description   

When running with SBE enabled, error_propagation.js gets an unexpected error code:

[js_test:error_propagation] uncaught exception: Error: command did not fail with any of the following codes [ 16554 ] {
[js_test:error_propagation] 	"ok" : 0,
[js_test:error_propagation] 	"errmsg" : "PlanExecutor error during aggregation :: caused by :: only numbers and dates are allowed in an $add expression",
[js_test:error_propagation] 	"code" : 4974201,
[js_test:error_propagation] 	"codeName" : "Location4974201",
[js_test:error_propagation] 	"$clusterTime" : {
[js_test:error_propagation] 		"clusterTime" : Timestamp(1617737256, 12),
[js_test:error_propagation] 		"signature" : {
[js_test:error_propagation] 			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
[js_test:error_propagation] 			"keyId" : NumberLong(0)
[js_test:error_propagation] 		}
[js_test:error_propagation] 	},
[js_test:error_propagation] 	"operationTime" : Timestamp(1617737256, 12)
[js_test:error_propagation] } :
[js_test:error_propagation] _getErrorWithCode@src/mongo/shell/utils.js:25:13
[js_test:error_propagation] doassert@src/mongo/shell/assert.js:18:14
[js_test:error_propagation] _assertCommandFailed@src/mongo/shell/assert.js:787:21
[js_test:error_propagation] assert.commandFailedWithCode@src/mongo/shell/assert.js:833:16
[js_test:error_propagation] @jstests/sharding/error_propagation.js:21:1
[js_test:error_propagation] @jstests/sharding/error_propagation.js:1:2
[js_test:error_propagation] failed to load: jstests/sharding/error_propagation.js
[js_test:error_propagation] exiting with code -3



 Comments   
Comment by Githook User [ 13/Apr/21 ]

Author:

{'name': 'Eric Cox', 'email': 'eric.cox@mongodb.com', 'username': 'ericox'}

Message: SERVER-56046 Add SBE error code mapping for $add with invalid args
Branch: master
https://github.com/mongodb/mongo/commit/a673a03c6c8ab4629ea3c1d7cab4814d559a2aea

Comment by Eric Cox (Inactive) [ 13/Apr/21 ]

The error semantics between the classic engine and sbe seem to be equivalent, in both engines we throw if $add has args that are not numbers nor dates. The error_propigation.js test only asserts on error code 16554. The classic engine throws 16554 in line 327 of mongo/db/pipeline/expression.cpp and sbe EFails with error code 4974201 in mongo/db/query/sbe_stage_builder_expression.cpp:783.

I think the proposed fix is simple. We need to add error code 4974201 to the equivalent error code list for 16554 in jstests/libs/sbe_assert_error_override.js.

Generated at Thu Feb 08 05:38:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.