Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1925

Detecting default or unset value with mongoc_read_prefs_get_max_staleness_seconds()

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.5.0
    • Affects Version/s: 1.5.0
    • Component/s: libmongoc
    • None

      Clients estimate the staleness of each secondary, and select for reads only those secondaries whose estimated staleness is less than or equal to maxStalenessSeconds. The default is -1, meaning no maximum staleness.

      Is there a particular reason that NO_MAX_STALENESS is private, unlike MONGOC_WRITE_CONCERN_W_DEFAULT? As-is, this pushes developers to rely on a magic number in their application to detect a default or simply determine if a read preference has a maxStalenessSeconds option applied to it.

      Should developers simply assume that any invalid value (i.e. <= 0) is effectively unset?

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: