Operational Defect Database

BugZero found this defect 38 days ago.

MongoDB | 2639225

$setWindowFields aggregate commands generate unstable hashes

Last update date:

4/11/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

Repeatedly setting query settings on aggregate([\{$setWindowFields: ...}]) queries generates multiple query shape configurations due to diverging query shape hashes. Enterprise rs0 [direct: primary] test> db.adminCommand({ setQuerySettings: { aggregate: "test", pipeline: [{ $setWindowFields: { partitionBy: { int_field: "$int_field", other_field: "$other_field" }, output: { count: { $sum: 1 } } } }, { $project: { _id: 0 } }], $db: "test" }, settings: { indexHints: { ns: { db: "test", coll: "test" }, allowedIndexes: ["a_1"] } } }) { queryShapeHash: '5902836CF946238C384741B17CFF8EC94698DC3FE049ADC70B252AF81954347E', settings: { indexHints: { ns: { db: 'test', coll: 'test' }, allowedIndexes: [ 'a_1' ] } }, representativeQuery: { aggregate: 'test', pipeline: [ { '$setWindowFields': { partitionBy: { int_field: '$int_field', other_field: '$other_field' }, output: { count: { '$sum': 1 } } } }, { '$project': { _id: 0 } } ], '$db': 'test' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1712852882, i: 2 }), signature: { hash: Binary.createFromBase64("AAAAAAAAAAAAAAAAAAAAAAAAAAA=", 0), keyId: Long("0") } }, operationTime: Timestamp({ t: 1712852882, i: 2 }) } Enterprise rs0 [direct: primary] test> db.adminCommand({ setQuerySettings: { aggregate: "test", pipeline: [{ $setWindowFields: { partitionBy: { int_field: "$int_field", other_field: "$other_field" }, output: { count: { $sum: 1 } } } }, { $project: { _id: 0 } }], $db: "test" }, settings: { indexHints: { ns: { db: "test", coll: "test" }, allowedIndexes: ["a_1"] } } }) { queryShapeHash: '247818291A399B424BCF04722ABC42CB9109C7EEF6B02A7F796BE3D255DDDBB7', settings: { indexHints: { ns: { db: 'test', coll: 'test' }, allowedIndexes: [ 'a_1' ] } }, representativeQuery: { aggregate: 'test', pipeline: [ { '$setWindowFields': { partitionBy: { int_field: '$int_field', other_field: '$other_field' }, output: { count: { '$sum': 1 } } } }, { '$project': { _id: 0 } } ], '$db': 'test' }, ok: 1, '$clusterTime': { clusterTime: Timestamp({ t: 1712852884, i: 1 }), signature: { hash: Binary.createFromBase64("AAAAAAAAAAAAAAAAAAAAAAAAAAA=", 0), keyId: Long("0") } }, operationTime: Timestamp({ t: 1712852884, i: 1 }) }

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Backlog

Learn More

Search:

...