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

Hedging options should only be available on `mongos`

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Service Arch
    • ALL
    • Hide

      Try running the following against a mongod server:

      db.adminCommand( { getParameter : 1, "readHedgingMode" : 1 } );
      
      Show
      Try running the following against a mongod server: db.adminCommand( { getParameter : 1, "readHedgingMode" : 1 } );

      Hedging is controlled by the following server parameter, settable at both startup and runtime:

      server_parameters:
        readHedgingMode:
          description: >-
              Enables hedged reads.
          set_at: [ startup, runtime ]
          cpp_class:
            name: HedgingModeServerParameter
      

      The parameter is mapped to a global atomic, defined here and initialized to enabled:

      AtomicWord<ReadHedgingMode> gReadHedgingMode{ReadHedgingMode::kOn};
      

      This server parameter, along with other mongos-specific parameters (e.g., loadBalancerPort), is packed with async_requests_sender:

      env.Library(
          target='async_requests_sender',
          source=[
              'async_requests_sender.cpp',
          ],
          LIBDEPS=[
              ...
              'mongos_server_parameters',
          ],
          LIBDEPS_PRIVATE=[
              '$BUILD_DIR/mongo/executor/hedge_options_util',
          ],
      )
      

      However, there are non-mongos compilation units that link against this target. For example, the following makes hedging and other mongos-specific behavior available for mongod servers:

      env.Library(
          target='sharded_agg_helpers',
          ...
          LIBDEPS=[
              ...
              '$BUILD_DIR/mongo/s/async_requests_sender',
              ...
          ],
      )
      

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: