[SERVER-81484] Take DDL lock of view nss on ShardingDDLCoordinators that operate on the buckets collection Created: 27/Sep/23  Updated: 29/Oct/23  Resolved: 06/Oct/23

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

Type: Task Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-79661 Make "internalRenameIfOptionsAndIndex... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2023-10-02, Sharding EMEA 2023-10-16
Participants:

 Description   

When working with time series, some operations issue DDL operations directly on the buckets collection. One example of that is $out's rename step (which today does not use ShardingDDLCoordinators, but after SERVER-79661 will).

Today, ShardingDDLCoordinators that operate on the buckets will take the DDL locks on the buckets collection, and never on the view nss. Conversely, coordinators that operate on a timeseries view will take DDL locks on both the view and the buckets, only if it is a sharded timeseries that already exists.

This poses a problem in an scenario where (i) the view does not yet exist, (ii) a ddl operation runs on the buckets, (iii) and a concurrent create occurs on the view nss. In this situation, two conflicting coordinators run concurrently and conflict on acquiring the critical section on the buckets.

A solution to this could be to make a ShardingDDLCoordinator that operates on a buckets collection also acquire the locks for the view nss. A additional upside to this is that it simplifies (removes) this logic in ShardingDDLCoordinator.



 Comments   
Comment by Githook User [ 06/Oct/23 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-81484 Take DDL lock of view nss on ShardingDDLCoordinators that operate on the buckets collection
Branch: master
https://github.com/mongodb/mongo/commit/4f2a1244ae5f0b92ac8954c1f2f32724123fa6fd

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