-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Catalog and Routing
-
ALL
-
-
🟦 Shard Catalog
-
None
-
None
-
None
-
None
-
None
-
None
In the shard-local implementation of create collection we take the MODE_IX lock on the collection. This means that multiple create operations can run concurrently for the same namespace. Consider the following problematic scenario:
- operation_A: starts with OFCV 8.0 sees that the collection does not exists yet
- FCV transition from 8.0 to 9.0
- operation_B: starts with OFCV 9.0 sees that the collection does not exists yet
- operation_A (OFCV 8.0): create the legacy timeseries buckets collection (`db.system.buckets.ts_coll`)
- operation_B (OFCV 9.0): create a viewless timeseries (`db.ts_coll`)
So we end up with an inconsistent state in the catalog where both `db.ts_coll` and `db.system.buckets.ts_coll` exists as timeseries collections.
The bug can occur only if:
- viewless timeseries feature flag is enabled in FCV 9.0
- We are on a replicaset cluster. On sharded clusters create operations are serialized through the DDL collection lock.