Operational Defect Database

BugZero found this defect 62 days ago.

MongoDB | 2612105

Update fuzzer test unique indexes in light of differing $mod behavior between 7.0 and 7.3+

Last update date:

3/18/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

https://jira.mongodb.org/browse/BF-32195 was caused by a partial unique index that includes this filter in an OR "$and" : [ { "obj.obj.obj.obj.obj.obj.num" : { "$type" : "long" } } ] This query results in differing unique index behavior on the two versions. db.fuzzer.runCommand({ "update" : "fuzzer", "updates" : [ { "q" : { }, "u" : [ { "$addFields" : { "obj.obj.obj.obj.obj.obj.num" : { "$mod" : [ NumberLong("314159265358979383"), 34928 ] } } } ], "multi" : true } ]}) The $mod on 7.0 produces a long (and so send every document in the collection to the index, resulting in a duplicate key error). On 7.3 / 8.0 it produces an int and does not result in a duplicate key error. https://jira.mongodb.org/browse/DEVPROD-5208 resolved a similar issue. Avoiding "$type" : "long" anywhere in a partial unique index's filter should resolve the issue.

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...