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

Helpers and internal command calls that don't obey read preference shouldn't raise UserWarning

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.7
    • 2.7.1, 3.0
    • None
    • None

    Description

      In PYTHON-577 we started raising UserWarning when a call to db.command ignores the user specified read preference and re-directs the command to the primary. This happens for any command not listed in read_preferences.secondary_ok_commands.

      Unfortunately a number of internal calls to db.command, and helpers for commands that don't obey read preference, are causing UserWarning to be raised when db.read_preference is set to anything other than PRIMARY.

      A few things need to be fixed:

      • Helpers that don't obey read preference should explicitly pass ReadPreference.PRIMARY to db.command.
      • Internal calls for non-obedient commands should do the same (e.g. md5sum in gridfs)
      • The test suite should be fixed so that problems like this aren't obscured in the future.

      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: