Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-723

Driver support for server Hedged Reads

    • Type: Icon: Epic Epic
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • Labels:
      None
    • Not Needed
    • Hide

      There will be a new mongos setParameter "readHedgingMode" that allows eligible "nearest" reads to be "hedged" by sending a request to a second member after waiting on the first member for a period. This parameter will be "on" by default.

      There will also be a new readPreference field "hedge" that allows explicitly opting into hedging behavior as above.

      Show
      There will be a new mongos setParameter "readHedgingMode" that allows eligible "nearest" reads to be "hedged" by sending a request to a second member after waiting on the first member for a period. This parameter will be "on" by default. There will also be a new readPreference field "hedge" that allows explicitly opting into hedging behavior as above.
    • Hide

      Hedged Reads

      Show
      Hedged Reads
    • 100
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      PYTHON-2170 Fixed 3.11
      MOTOR-516 Gone away
      GODRIVER-1538 Fixed 1.4.0
      NODE-2510 Fixed 3.6.0
      RUBY-2184 Fixed 2.13.0.beta1
      JAVA-3666 Fixed 4.1.0
      CDRIVER-3583 Fixed 1.17.0-beta2, 1.17.0
      CXX-1966 Fixed 3.6.0-rc0, 3.6.0
      CSHARP-3019 Fixed 2.11.0
      RUST-325 Fixed 1.2.0
      SWIFT-741 Won't Do
      PHPC-1571 Fixed 1.8.0-beta2, 1.8.0
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion PYTHON-2170 Fixed 3.11 MOTOR-516 Gone away GODRIVER-1538 Fixed 1.4.0 NODE-2510 Fixed 3.6.0 RUBY-2184 Fixed 2.13.0.beta1 JAVA-3666 Fixed 4.1.0 CDRIVER-3583 Fixed 1.17.0-beta2, 1.17.0 CXX-1966 Fixed 3.6.0-rc0, 3.6.0 CSHARP-3019 Fixed 2.11.0 RUST-325 Fixed 1.2.0 SWIFT-741 Won't Do PHPC-1571 Fixed 1.8.0-beta2, 1.8.0

      Epic Summary

       

      Summary

      Send N reads in parallel, to the two “best” hosts. After one result comes back, cancel other outstanding operations, drain their sockets on background threads and send that first result back to the user.

      By default, do this for nearest with a hedging of 2. With some kind of fanciness to determine if this is useful / effective

      Motivation

      Users want fast reads, but sometimes they send a read to a host which is slow (when another eligible host would have been faster). It’s also sometimes not possible to know this ahead of time.

      Driver implementation

      Initially we intend to support hedged reads for sharded clusters, so the drivers work is simply to pass hedging-related client application configuration through to mongos servers. Here's an example of a readPreference document with explicit hedging parameters:

      {
          mode: “nearest”
          hedge: {
              enabled: true,    // optional, defaults to true
          }
      }
      

       

      Documentation

      spec change.
       

            Assignee:
            Unassigned Unassigned
            Reporter:
            esha.bhargava@mongodb.com Esha Bhargava
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: