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

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

    • Fully Compatible
    • ALL
    • Service Arch 2019-10-07, Service Arch 2019-10-21
    • 8

      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

            Assignee:
            rahul.sundararaman@mongodb.com Rahul Sundararaman (Inactive)
            Reporter:
            mira.carey@mongodb.com Mira Carey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: