[SERVER-40513] BSONElementHasher does not convert its seed to little endian Created: 06/Apr/19  Updated: 29/Oct/23  Resolved: 15/Apr/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.11

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

Issue Links:
Depends
Backwards Compatibility: Minor Change
Operating System: ALL
Sprint: Query 2019-04-22
Participants:
Linked BF Score: 50

 Description   

The 'seed' of the hash is a 4-byte number that gets used as the first four bytes of the md5sum input. These bytes are not converted to little endian, however, so on big endian (s390x in particular) platforms, the hash returns a different result unless the seed is 0 or some other value with endian-wise symmetry.

 

Hashed indexes are hard-wired to use 0 as the seed, so this is not a data correctness problem.



 Comments   
Comment by Githook User [ 15/Apr/19 ]

Author:

{'name': 'Justin Seyster', 'username': 'jseyster', 'email': 'justin.seyster@mongodb.com'}

Message: SERVER-40513 Convert seed to little endian before hashing
Branch: master
https://github.com/mongodb/mongo/commit/ec5473699c86897dc98fca6aac63eb92dcbcc1c4

Comment by Charlie Swanson [ 08/Apr/19 ]

justin.seyster should this be linked to a BF? putting it in the sprint so it doesn't get lost, but we can move it out of the sprint if it's linked to a BF.

Generated at Thu Feb 08 04:55:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.