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

Driver support for server Hedged Reads

    XMLWordPrintable

Details

    • Epic
    • Status: Implementing
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None
    • 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.
    • 100

    Description

      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.
       

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: