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

Introduce the collection acquisition logic from the shard-role api into the validate command

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • RSS Sydney
    • ALL
    • v8.0
    • CAR Team 2024-04-15, CAR Team 2024-04-29, Execution Team 2024-06-24, Execution Team 2024-07-08, Execution Team 2024-07-22, GregsList - 2024-09-03, PopcornChicken - 2024-09-17, MorningKaraoke 2024-10-01

      Currently, the validate command does not use the collection acquisition logic provided by the shardRole API. As a result, changes in collection placement can be left undetected, leading to errors in cases where a refresh would be expected. One such example is the scatter-gather inside the cluster validate command which may fail with a NamespaceNotFound error, when it interleaves with a moveCollection

      To prevent the occurrence of such errors, a general solution can be obtained by means of the Shard Versioning Protocol. The ShardVersion is attached to requests that are sent by the router and can be used by the validate command to detect changes in collection placement. If such a change is detected, a StaleConfig exception can be propagated back to the router, with the request being repeated as a result. This behaviour is already implemented as part of the collection acquisition logic within the shard role api.

      The goal of this ticket is to adjust the collection acquisition code used by the validate command, such that ShardVersion mismatches are detected.

      A reproducer for the expected behaviour can be found here

            Assignee:
            nic.hollingum@mongodb.com Nic Hollingum
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: