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

Change "no maxStalenessSeconds" value from 0 to -1

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • Labels:
      None
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      PYTHON-1169 Done 3.4
      CDRIVER-1908 Done 1.5.0
      CSHARP-1833 Duplicate 2.4
      SCALA-285 Done
      PHPC-840 Duplicate
      RUBY-1177 Done 2.4.0
      CXX-1139 Duplicate
      JAVA-2383 Done 3.4.0
      NODE-858 Done 2.2.12
      PERL-684 Done 1.6.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-1169 Done 3.4 CDRIVER-1908 Done 1.5.0 CSHARP-1833 Duplicate 2.4 SCALA-285 Done PHPC-840 Duplicate RUBY-1177 Done 2.4.0 CXX-1139 Duplicate JAVA-2383 Done 3.4.0 NODE-858 Done 2.2.12 PERL-684 Done 1.6.0

      In DRIVERS-335 we rename maxStalenessMS to maxStalenessSeconds and change the smallest value for it. In this ticket, we change the behaviors for maxStalenessSeconds=0 and maxStalenessSeconds=-1.

      The spec originally specified 0 for "no max", but that value is confusing. Users will expect 0 to mean "no lag". The spec has been updated to use -1 instead (0 is now illegal).

      A MongoClient with this connection string has no max staleness, the same as if "maxStalenessSeconds" were omitted from the connection string:

      mongodb://host/?readPreference=secondary&maxStalenessSeconds=-1

      This connection string with mode "primary" is valid and does not raise an error:

      mongodb://host/?readPreference=primary&maxStalenessSeconds=-1

      Same with this implicit mode "primary", this is valid too:

      mongodb://host/?maxStalenessSeconds=-1

      In code, -1 is an acceptable value meaning "no max staleness". E.g. in PyMongo:

      MongoClient(readPreference="secondary", maxStalenessSeconds=-1)

      You MAY accept null in code, too: up to you.

      These are no longer valid:

      mongodb://host/?readPreference=secondary&maxStalenessSeconds=0
      mongodb://host/?readPreference=primary&maxStalenessSeconds=0

      You can choose whether to explicitly prohibit 0 and raise an error as soon as the URI is parsed, or later when you're in server selection you could raise an error since maxStalenessSeconds=0 is too small: maxStalenessSeconds must be at least heartbeatFrequencyMS + idleWriteFrequencyMS (DRIVERS-335).

            Assignee:
            Unassigned Unassigned
            Reporter:
            rathi.gnanasekaran Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: