[SERVER-70005] SetIndexVersion in CollectionType should not be able to change collection uuid Created: 27/Sep/22  Updated: 29/Oct/23  Resolved: 13/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Task Priority: Major - P3
Reporter: Allison Easton Assignee: Allison Easton
Resolution: Fixed Votes: 0
Labels: PM-2583-Milestone-3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-02-06, Sharding EMEA 2023-02-20
Participants:

 Description   

This ticket is being created out of a comment in the PR of SERVER-69622 to address the unsafe setIndexVersion functions in the CollectionType. The comment is pasted below:

I think such ability to set the timestamp/epoch/index version separately from the collection identity is a little bit dangerous, because there is nothing to guarantee that someone doesn't put a different collection identity with one or the other.

  1. Get rid of setEpoch/setTimestamp and substitute them with one method called setCollectionVersions (or something similar), which I guess currently will take just the identity and the CollectionIndexes, but in the future we can add whatever other components we decide to add. If it is possible to make this be the constructor (without a setter, even better).
  2. Remove setIndexVersion altogether
  3. (Optional and later): Get rid of getEpoch / getTimestamp and replace them with getIdentity.


 Comments   
Comment by Githook User [ 13/Feb/23 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com', 'username': 'allisoneaston'}

Message: SERVER-70005 SetIndexVersion in CollectionType should not be able to change collection uuid
Branch: master
https://github.com/mongodb/mongo/commit/2246d9fd8db9eede8edfe6e5ce0fd95591839a44

Generated at Thu Feb 08 06:15:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.