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

Make commit of refine collection shard key idempotent

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: 8.0.0-rc0, 8.1.0-rc0
    • Component/s: Sharding
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2024-09-30, CAR Team 2024-10-14
    • 200

      The new refineCollectionShardKey implementation introduced by SERVER-76486 contains an idempotency check, however, in case of a config server stepdown, it is possible that this check passes due to the commit not being fully applied yet.

      SERVER-79064 removed the old refine collection shard key code, however, it made a second idempotency check a tassert, this is not necessary, in fact, if the collection was not found, we could actually assume that the commit already happened, considering the find command is checking the old collection timestamp.

      We should make sure to detect and handle any idempotency situations with either as a no-op commit or a retriable error, but never triggering a tassert. An option would be to remove that tassert, and make the entire commit a no-op if no collection is found with that timestamp, making the commit command idempotent.

            Assignee:
            joan.bruguera-mico@mongodb.com Joan Bruguera Micó
            Reporter:
            marcos.grillo@mongodb.com Marcos José Grillo Ramirez
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: