-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
-
Query Execution 2021-05-17
I was working on something totally unrelated and ran "aggregation_multiversion_fuzzer" with SBE enabled, and I found an interesting failure:
I was able to boil it down to the following repro:
> db.coll.insert({a: 1}); > db.coll.aggregate([{"$project": {"a.x": "$a.x", "a.b.x": "$a.x"}}]);
Running these commands with SBE enabled will produce the following error message:
uncaught exception: Error: command failed: { "ok" : 0, "errmsg" : "undefined slot accessor:6", "code" : 4946301, "codeName" : "Location4946301"} with original command request: { "aggregate" : "coll", "pipeline" : [ { "$project" : { "a.x" : "$a.x", "a.b.x" : "$a.x" } } ], "cursor" : { }, "lsid" : { "id" : UUID("fd211cab-715c-41fa-827c-c0ae006ca0a8") }} on connection: connection to 127.0.0.1:27017 : aggregate failed
Running these commands with SBE disabled produces no error.
I attached gdb and I managed to print out the generated SBE plan that is causing theĀ "undefined slot accessor:6" error (see below). It appears that "s6" is being read from in a context where it is not defined.
The goal of this task is to fix this bug.
== SBE plan of the aggregate() command that fails ==
[2] traverse s22 s21 s3 {} {} from [1] scan s3 s4 none none none none [] @"7a47a3f3-af02-40d4-960c-caaa4a5da425" true false in [2] mkbson s21 s3 [_id] keep [a = s20] true false [2] traverse s20 s19 s5 {} {} from [2] project [s5 = getField (s3, "a")] [2] limit 1 [2] coscan in [2] mkbson s19 s5 [] keep [x = s10, b = s18] true false [2] project [s10 = s7] [2] traverse s18 s17 s11 {} {} from [2] project [s11 = getField (s5, "b")] [2] traverse s7 s7 s6 {} {} from [2] project [s6 = getField (s3, "a")] [2] limit 1 [2] coscan in [2] project [s7 = s9] [2] traverse s9 s9 s8 {} {} from [2] project [s8 = getField (s6, "x")] [2] limit 1 [2] coscan in [2] project [s9 = s8] [2] limit 1 [2] coscan in [2] mkbson s17 s11 [] keep [x = s16] true false [2] project [s16 = s13] [2] traverse s13 s13 s12 [s6, s7] {} {} from [2] project [s12 = getField (s3, "a")] [2] limit 1 [2] coscan in [2] project [s13 = s15] [2] traverse s15 s15 s14 {} {} from [2] project [s14 = getField (s12, "x")] [2] limit 1 [2] coscan in [2] project [s15 = s14] [2] limit 1 [2] coscan
- is depended on by
-
SERVER-52799 Make sbe the default execution engine and switch "SBE" build variant to "SBE off"
- Closed