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 router

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Cluster Scalability
    • CAR Team 2024-09-16

      The transaction router's current implementation for identifying transaction commands (such as commit or abort) is flawed. The router uses an isTransactionCommand helper function that checks if a command is a transaction command by looking it up in its local registry. It throws CommandNotFound in case not found.

      This approach has two main problems:

      1. It assumes that any command that runs as part of a transaction (such as create or insert) must be known by the router itself
      2. It assumes that no conclusion can be made on a command not found locally

      Regarding the first point, the proper verification is already performed at the entry point of each node when a command is received. A router should not assume a command's non-existence simply because it's not registered internally.

      As for the second point, we can safely assume that transaction-specific commands (commit, abort, etc.) are always registered in the router, which acts as the transaction coordinator. Therefore, any command not found can be treated as a regular command.

      This ticket aims to assess the feasibility of eliminating the exception and instead treating all unregistered commands as regular commands by default.

            Assignee:
            Unassigned Unassigned
            Reporter:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: