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

sharding/read_pref_cmd.js should assume less about secondaryPreferred + tag_sets

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Service Arch 2019-10-07, Service Arch 2019-10-21
    • Linked BF Score:
      8

      Description

      From the server selection spec:

      primaryPreferred and secondaryPreferred
      'primaryPreferred' is equivalent to selecting a server with read preference mode 'primary' (without tag_sets or maxStalenessSeconds), or, if that fails, falling back to selecting with read preference mode 'secondary' (with tag_sets and maxStalenessSeconds, if provided).

      'secondaryPreferred' is the inverse: selecting with mode 'secondary' (with tag_sets and maxStalenessSeconds) and falling back to selecting with mode 'primary' (without tag_sets or maxStalenessSeconds).

      Depending on the implementation, this may result in cleaner code.

      sharding/read_pref_cmd.js assumes that secondaryPreferred + tag_sets won't hit the primary if it doesn't have the designated tag. But that isn't how it's coded, or how server selection is intended to work.

      We should remove those test cases

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: