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

Do not perform collection version check for create collection

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: 5.0.0, 6.0.0, 7.0.0
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • v7.3, v7.0, v6.0, v5.0
    • CAR Team 2024-04-01
    • 140

      Revert SERVER-88477 once the RCA has been completed.

      The test was failing due to the following problem:

      When the mongos send a create command for a timeseries collection to the shard, it will use `executeCommandAgainstDatabasePrimary` helper. This help will attach both the database version and an UNSHARDED collection version.

      When the shard executes the command, it will first (1.) create the bucket collection, and then (2.) it will try to create the associated timeseries view .

      If the collection metadata for the view are currently unknown by, the shard will fail with StaleConfig error before actually (2.) creating the timeseries view. Leaving a bucket collection without its associate view.

      The reason is that before 2 we perform a AutoGetCollection that is checking the collection version.

      One possible solution to solve this would be to use executeDDLCoordinatorCommandAgainstDatabasePrimary instead of executeCommandAgainstDatabasePrimary to forward the create command from the router to the shard. The former is only attaching the database version and thus AutoGetCollection will only perform database version check instead of collection version check.

      It is correct to only perform db version check and skip collection version check in this case because we are only using cached database information to perform routing.

            Assignee:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: