BugZero found this defect 132 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/15/2024
MongoDB Server
6.1.0
7.0.0
7.3.0-rc0
7.2.0
No fixed releases provided.
Detailed description of the problem in the related BF. Currently, the checks of the shard version when creating the bucket namespace are not run due to the shard version not being set on the bucket namespace in the OperationShardingState. This can lead to unsharded and sharded collection creation not serializing correctly. The occurrence in the BF shows that this can happen when sharding a collection without timeseries options and creating a timeseries collection. However, the reverse is also true. If we are sharding a collection with timeseries options, then we will use the local catalog create timeseries command which creates the bucket namespace and then afterwards, creates the view namespace. If, after the bucket namespace is created, a create command for the view namespace (just as a regular collection) comes in, it will find the bucket namespace in the local catalog and set the shard version on the bucket namespace. The create will then only take the collection lock for the original namespace (non-bucket) and so will never check the shard version and critical section.
Repro attached to BF.