[SERVER-71177] Timeseries collection creation fails due to incompatible validator between 6.0 and subsequent versions Created: 08/Nov/22  Updated: 29/Oct/23  Resolved: 23/Feb/23

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

Type: Bug Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
is caused by SERVER-68129 Add the field `control.count` to the ... Closed
Assigned Teams:
Storage Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.3, v6.0
Sprint: Execution Team 2023-02-20, Execution Team 2023-02-06, Execution Team 2023-03-06
Participants:
Linked BF Score: 14

 Description   

The steps that leads to this issue are the following:

  1. Start timeseries collection creation on the replset primary node with binary 6.0
  2. Stepdown happens here after creating the bucket collection but before creating the associated view.
  3. A new primary of replicaset with binary 6.1 or later is elected
  4. Retry the same create collection

The second create will fail with:

NamespaceExists: Bucket Collection already exists

And it will leave a bucket collection without the associated view.

The reason is that the second create operation will not find the view but it will find the bucket collection, then it will try to see if collectionOptions of the existing bucket collection match the options from the second create operation and it will fail because the validator created in 6.0 is different from the one of later versions. In fact in SERVER-68129 we added the control.count field.



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

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-71177 Allow existing time-series bucket collections with old validator version when creating time-series collections
Branch: master
https://github.com/mongodb/mongo/commit/9ced3cf3642929a56e741752ba742a4a9b4a847a

Comment by Henrik Edin [ 13/Feb/23 ]

This case is equivalent to not being able to create a time-series collection due to something incompatible occupying the bucket namespace. The tests begin by dropping any previous collections/views but when collections occupy both the user-facing namespace and the bucket namespace only one Collection will be dropped. I'm worried about the impact of prohibiting collections on both namespaces in our tools and initial sync. It is best to defer cleaning this up until we can create both the time-series view and bucket collection atomically and deal with any upgrade/downgrade issues at that point.

We can put a bandaid in our tests by calling drop twice which will ensure we will succeed with creating a time-series collection when we started in the situation outlined above.

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