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

Refactor isTransactionCommand in transaction_validation.cpp to take into account commands not registered on mongos

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • Catalog and Routing
    • ALL

    Description

      As a part of PM-3364 after SERVER-81189 the {create..} command instead of running directly against the primary will run _shardsvrCreateCollection on the primary which creates the collection.

      However, in case {create...} runs a part of a transaction, the following check is perform on mongos which fails in case of _shardsvrCreateCollection due to CommandHelpers::findCommand since the command is only present on shard servers 

      As a part of SERVER-81189 a simple fix was added to  force returning false in case of _shardsvrCreateCollection: https://github.com/mongodb/mongo/search?q=SERVER-82282&type=Code

      There is no good reason to fail in case the command is not found since this check is already performed by the entry point . 

      The helper should probably instead either:

      • return default false in case a command is not found
      • perform the check on the shard instead of mongos 
      • Any other solution that can make the code better maintainable  

      Attachments

        Activity

          People

            backlog-server-catalog-and-routing Backlog - Catalog and Routing
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: