[SERVER-56102] Fix SBE bit-test operators to match classic engine for Decimal values Created: 14/Apr/21 Updated: 29/Oct/23 Resolved: 29/Apr/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Query Execution |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | Drew Paroski |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Sprint: | Query Execution 2021-05-03 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
This was caught by the aggregation_multiversion_fuzzer, but I distilled it into a simple handwritten repro:
Running this repro shows that for the example $bitsAnyClear match expression, the document matches when SBE is off but fails to match when SBE is on. The bitwise operations predate the introduction of NumberDecimal, so it's quite possible that the behavior prior to SBE was incidental – why would you do bitwise operations against a NumberDecimal anyway? Looking at the code quite quickly, my guess is that SBE is bailing out here: |
| Comments |
| Comment by Githook User [ 29/Apr/21 ] |
|
Author: {'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}Message: |
| Comment by David Storch [ 14/Apr/21 ] |
|
This one appears to be the same problem manifesting due to a bit-test match expression inside a $match in the subpipeline of a $lookup. |
| Comment by David Storch [ 14/Apr/21 ] |
|
Here is a slightly different example where this appears to manifest inside the restrictWithMatch match expression of a $graphLookup. See related ticket |
| Comment by David Storch [ 14/Apr/21 ] |
|
One more example. At this point, I'll probably stop linking any more duplicates. |
| Comment by David Storch [ 14/Apr/21 ] |
|
This task appears at a glance to be another instance of the same problem, this time involving $bitsAnySet. |