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

db.currentOp() fails with read preference set

    • Fully Compatible
    • ALL
    • Hide

      rs_DI:PRIMARY> db.getMongo().setReadPref("primary")
      rs_DI:PRIMARY> db.currentOp()
      2015-04-09T09:36:51.333+0000 DBClientCursor::init call() failed
      2015-04-09T09:36:51.334+0000 Error: error doing query: failed at src/mongo/shell/query.js:81
      2015-04-09T09:36:51.336+0000 trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed
      2015-04-09T09:36:51.337+0000 reconnect 127.0.0.1:27017 (127.0.0.1) ok

      Show
      rs_DI:PRIMARY> db.getMongo().setReadPref("primary") rs_DI:PRIMARY> db.currentOp() 2015-04-09T09:36:51.333+0000 DBClientCursor::init call() failed 2015-04-09T09:36:51.334+0000 Error: error doing query: failed at src/mongo/shell/query.js:81 2015-04-09T09:36:51.336+0000 trying reconnect to 127.0.0.1:27017 (127.0.0.1) failed 2015-04-09T09:36:51.337+0000 reconnect 127.0.0.1:27017 (127.0.0.1) ok
    • BUILD 2 04/24/15

      Issue Status as of Apr 29, 2015

      ISSUE SUMMARY
      In the mongo shell, the killOp, currentOp, and fsyncUnlock operations produce errors with non-primary read preferences.

      USER IMPACT
      In the mongo the killOp, currentOp, and fsyncUnlock operations fail when sent with non-primary read preferences and the client disconnects. Drivers are not affected by this issue as they currently remove read preference before sending these commands.

      WORKAROUNDS
      Set primary read preference while running the killOp, currentOp, and fsyncUnlock operations in the shell.

      AFFECTED VERSIONS
      MongoDB 2.4.0 to 3.0.2

      FIX VERSION
      The fix is included in the 3.0.3 production release.

      Original description

      When I set a read preference, e.g. db.getMongo().setReadPref("primary") or db.getMongo().setReadPref("secondary"), db.currentOp() fails both on mongod and mongos.

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            ole Ole Langbehn
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: