Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-812

localThresholdMS should be a global immutable value

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.0
    • None
    • None
    • Major Change

    Description

      Currently local threshold is set as an option for individual instances of read preference classes:

      # PyMongo 3.0-dev, removed by this change.
      from pymongo.read_preferences import Secondary
      rp = Secondary(latency_threshold_ms=20000)

      This ticket tracks making localThreshold global and immutable. That is, it can only be set through the URI option localThresholdMS, or passed to the constructor for MongoClient as a keyword argument:

      client = pymongo.MongoClient('mongodb://localhost:27017/?localThresholdMS=20000')
      client = pymongo.MongoClient(localThresholdMS=20000)

      It can not be reset after client creation and is not settable per Database, Collection, or operation. mongos does not support per operation changes to localThreshold through the $readPreference directive, so the existing driver API can lead to dramatic behavior changes when migrating from a standalone mongod or replica set to a sharded cluster.

      Attachments

        Activity

          People

            bernie@mongodb.com Bernie Hackett
            bernie@mongodb.com Bernie Hackett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: