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

Recreating a sharded timeseries collection as a sharded collection might lead to a read failure

    • Catalog and Routing
    • ALL
    • Hide
      1. Apply the attached patch in revision 107f24c
      2. Compile the server
      3. Run the test using the sharding suite:
         python ./buildscripts/resmoke.py run --suites=sharding ./jstests/sharding/test_find_classical_with_concurrent_drop.js --log=file
        
      Show
      Apply the attached patch in revision 107f24c Compile the server Run the test using the sharding suite: python ./buildscripts/resmoke.py run --suites=sharding ./jstests/sharding/test_find_classical_with_concurrent_drop.js --log=file
    • Sharding EMEA 2023-09-18, Sharding EMEA 2023-10-02, Sharding EMEA 2023-10-16, Sharding EMEA 2023-10-30, CAR Team 2023-12-25, CAR Team 2024-01-08, CAR Team 2024-01-22, CAR Team 2024-04-01
    • 2

      SERVER-60144 added functionality to check the shard version of a time series collection by assigning the bucket NamespaceString to the operation sharding state, however, in a read path the following interleaving might happen:

      1. A sharded timeseries collection with namespace db.coll is created successfully
      2. A read comes into the shard for the timeseries collection and the shard role is set in the OperationShardingState, notice that because it is a timeseries, the namespace is transformed from db.coll to db.system.buckets.coll
      3. A drop collection and a shard collection gets executed, successfully dropping and creating a new sharded collection with namespace db.coll
      4. The read path continues, selecting a filtering phase
      5. When trying to obtain the ownership filter, we find that there is no shard version set for the collection db.coll in the operation context, so we fail the command with a tassert

      Causing the read to fail. Usually on the find path, once it is detected the collection is actually a view (because timeseries collections are actually views), the read is transformed to an aggregation, but because a new sharded collection was created in step 3, the read continues as normal.

      We should find a way to check the shard version in the read path, in order to determine whether the collection still exists before acquiring the lock free raii.

        1. BF-29225_repro.patch
          3 kB
          Marcos José Grillo Ramirez

            Assignee:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Reporter:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: