Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-81484

Take DDL lock of view nss on ShardingDDLCoordinators that operate on the buckets collection

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Sharding EMEA 2023-10-02, Sharding EMEA 2023-10-16

      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.

            Assignee:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: