[SERVER-62783] Reduce the number of parsing/serialisation methods in ChunkVersion Created: 20/Jan/22  Updated: 29/Oct/23  Resolved: 25/Jan/22

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

Type: Improvement Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-02-07
Participants:

 Description   

Currently, there are 7 parsing and 6 serialisation method each with a subtle difference and check from the previous. However, fundamentally, there are only two types of chunk version BSONs that can possibly be generated:

The "legacy" format, which persists the version as fields within a BSON object (with the epoch being optional for chunk values, which have come from an upgrade that started at 2.2).

The "new" format, which is a BSONArray.

Under this ticket, we should ensure that there are only two variants of parse/serialise methods



 Comments   
Comment by Githook User [ 26/Jan/22 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-62783 Use the 'any' form for the wrongly encoded positional format

This allows one more method to be thrown out.
Branch: master
https://github.com/mongodb/mongo/commit/26e6d12d1957d579d5aa9bc7592b18e30dc7959f

Comment by Githook User [ 25/Jan/22 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-62783 Get rid of ChunkVersion::toBSON

Special-case the generation of the

{0:minor|major, 1:epoch, ...}

format
Branch: master
https://github.com/mongodb/mongo/commit/a7d04099d85b9a191b99576415ed1da2f1d835cf

Comment by Githook User [ 24/Jan/22 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-62783 Get rid of ChunkVersion::appendWithField/parseWithField
Branch: master
https://github.com/mongodb/mongo/commit/a2aff33b1f4fa49efd85b245e7945e720a775530

Comment by Githook User [ 24/Jan/22 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-62783 Get rid of ChunkVersion::appendToCommand/parseFromCommand
Branch: master
https://github.com/mongodb/mongo/commit/36da822b20fee2b73e65810c817fdc1e7fc2cd29

Comment by Githook User [ 24/Jan/22 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-62783 Make parsing of new and legacy formats more explicit
Branch: master
https://github.com/mongodb/mongo/commit/3bc48c6fd422822c849ad3c82b780122c64ec423

Comment by Githook User [ 24/Jan/22 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-62783 Move the version parsing for ShardCollectionType out of ChunkVersion
Branch: master
https://github.com/mongodb/mongo/commit/3ce4e1938871cfa86599cf37c871542a7f4ca4c4

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