[SERVER-21476] ChunkVersion assumes little-endian byte order Created: 16/Nov/15  Updated: 22/Feb/16  Resolved: 05/Feb/16

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

Type: Bug Priority: Major - P3
Reporter: Bryan Chan Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 10 (02/19/16)
Participants:

 Description   

The _minor and _major fields in ChunkVersion are unioned with a 64-bit _combined field, which are used for fast reads/writes and comparisons in little-endian order. This doesn't work on big-endian systems and causes failures in ChunkManagerTests that can be worked around by providing slower but portable versions of the accessor methods and comparison operators when MONGO_CONFIG_BYTE_ORDER == 4321.



 Comments   
Comment by Githook User [ 05/Feb/16 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-21476 ChunkVersion assumes little endian

Alter ChunkVersion to rely on bit arithmetic on a 64 bit unsigned,
rather than union type punning, to extract the minor and major versions.
This improves portability on big endian systems.
Branch: master
https://github.com/mongodb/mongo/commit/102e832f218ecdec47d8eebf4e827072075325d7

Generated at Thu Feb 08 03:57:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.