[SERVER-75369] Fix the overflow of total possible enumeration count in LockstepOr enumeration strategy Created: 28/Mar/23  Updated: 29/Oct/23  Resolved: 29/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0, 6.0.6, 4.4.22, 5.0.18

Type: Bug Priority: Major - P3
Reporter: Ruoxin Xu Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-74893 Change default enumeration strategy f... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.2, v6.0, v5.0, v4.4
Sprint: QO 2023-04-03
Participants:
Linked BF Score: 5

 Description   

There's a count variable for computing the total possible enumeration of a $or query.

This variable could overflow if the $or is large enough, e.g. a machine generated $or with 200 predicates. Each predicate has two possible enumerations. The size_t count would overflow with a value of 2^200.

While calculating the count, we can bail out early if the count reaches the limit for $or, which is 10 by default.



 Comments   
Comment by Githook User [ 03/May/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-75369 Fix the overflow of total possible enumeration count in LockstepOr enumeration strategy

(cherry picked from commit 6bb0a27e70d7484f4dc9532c35dc1f0c7be873a3)
Branch: v4.4
https://github.com/mongodb/mongo/commit/ced3d69805716ec47160ae74fb8b0286ff1cc39f

Comment by Githook User [ 03/May/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-75369 Fix the overflow of total possible enumeration count in LockstepOr enumeration strategy

(cherry picked from commit 6bb0a27e70d7484f4dc9532c35dc1f0c7be873a3)
Branch: v5.0
https://github.com/mongodb/mongo/commit/86f0588acc1204f0ef712f0562c96f993e55ac2d

Comment by Githook User [ 27/Apr/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-75369 Fix the overflow of total possible enumeration count in LockstepOr enumeration strategy

(cherry picked from commit 6bb0a27e70d7484f4dc9532c35dc1f0c7be873a3)
Branch: v6.0
https://github.com/mongodb/mongo/commit/c4231461fe7127f2e9a2b1543a1b9afa3552909e

Comment by Githook User [ 29/Mar/23 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-75369 Fix the overflow of total possible enumeration count in LockstepOr enumeration strategy
Branch: master
https://github.com/mongodb/mongo/commit/6bb0a27e70d7484f4dc9532c35dc1f0c7be873a3

Generated at Thu Feb 08 06:30:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.