[SERVER-62356] shardCollection for time-series is not done under the critical section Created: 04/Jan/22  Updated: 29/Oct/23  Resolved: 14/Sep/22

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

Type: Bug Priority: Major - P3
Reporter: Haley Connelly Assignee: Paolo Polato
Resolution: Fixed Votes: 0
Labels: time-series, timeseries_DDL_bug
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
causes SERVER-70006 CreateCollectionCoordinator should no... Closed
causes SERVER-79974 Time-series bucket change stream `sha... Closed
is caused by SERVER-57315 Enable shardCollection command for a ... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-04-04, QE 2022-02-07, QE 2022-02-21, QE 2022-03-07, QE 2022-03-21, QE 2022-01-24, QE 2022-04-18, QE 2022-05-02, QE 2022-05-16, Sharding EMEA 2022-06-27, Sharding EMEA 2022-07-11, Sharding EMEA 2022-07-25, Sharding EMEA 2022-08-08, Sharding EMEA 2022-08-22, Sharding EMEA 2022-09-05, Sharding EMEA 2022-09-19
Participants:
Linked BF Score: 169

 Description   

When sharding a time-series collection, we perform a catalog lookup and perform some extra steps. However, this state can change before we actually enter the critical section for the operation.



 Comments   
Comment by Githook User [ 16/Sep/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-62356 Fix multiversion suites
Branch: master
https://github.com/mongodb/mongo/commit/62ea49cf4617b71cbc03c0058ea477b0e86a8569

Comment by Githook User [ 14/Sep/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-62356 Serialise the creation of sharded Timeseries collection with other DDL ops
Branch: master
https://github.com/mongodb/mongo/commit/095cfdb2bd20b10d0a20ef876029120b69971368

Comment by Githook User [ 27/Jul/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: Revert "SERVER-62356 Serialize creation of sharded and unsharded Timeseries collections"

This reverts commit ab2ced056ac09ea256cc4ff00fb2cbd0344f622a.
Branch: master
https://github.com/mongodb/mongo/commit/bcd3d82cbb04a103f776e66705c4955326000a01

Comment by Githook User [ 26/Jul/22 ]

Author:

{'name': 'Paolo Polato', 'email': 'paolo.polato@mongodb.com', 'username': 'ppolato'}

Message: SERVER-62356 Serialize creation of sharded and unsharded Timeseries collections
Branch: master
https://github.com/mongodb/mongo/commit/ab2ced056ac09ea256cc4ff00fb2cbd0344f622a

Comment by Githook User [ 18/May/22 ]

Author:

{'name': 'Rui Liu', 'email': 'rui.liu@mongodb.com', 'username': 'lriuui0x0'}

Message: Revert "SERVER-62356 Move timeseries translation logic into create collection coordinator"

This reverts commit a3efbb9a26eba7f40392b3921ed0162c80b6b6d1.
Branch: master
https://github.com/mongodb/mongo/commit/228ce045ccff21992eeb1306f35c1bb2c489c0e9

Comment by Githook User [ 16/May/22 ]

Author:

{'name': 'Rui Liu', 'email': 'rui.liu@mongodb.com', 'username': 'lriuui0x0'}

Message: SERVER-62356 Move timeseries translation logic into create collection coordinator
Branch: master
https://github.com/mongodb/mongo/commit/a3efbb9a26eba7f40392b3921ed0162c80b6b6d1

Comment by Rushan Chen [ 05/Apr/22 ]

Assigning to Rui/

arun.banala, excluding other DDL during shard TS collection is likely acceptable.What do you think? Or the concern is the uasserts in that block? Still good idea to get it reviewed by sharding.

Comment by Arun Banala [ 24/Feb/22 ]

This does look like a problem, if there is a create and shardCollection command running for the same namespace in parallel. It doesn't feel like taking a lock on CollectionCatalog would work here. We can consider moving this whole time-series logic into the DDLCoordinator. We should also get guidance from Sharding team, as the DDLCoordinator itself doesn't let other DDL operations run in parallel.

Comment by Rushan Chen [ 19/Jan/22 ]

Hi Arun, could you please take a look and make sure the original shardCollection for time series is thread safe?

Comment by Kyle Suarez [ 14/Jan/22 ]

bernard.gorman or rushan.chen, can someone from the sharding time-series collection team take a look at this bug?

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