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

Possible to run user mgmt read commands on secondary

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.6.0-rc0
    • Affects Version/s: 2.5.4
    • Component/s: Security
    • Labels:
    • Fully Compatible
    • ALL
    • Hide

      Start a replica set, it will run with read preference Primary by default.
      Connect with the shell to the secondary:

      rs0:SECONDARY> db.getRole('a')
      2014-01-31T14:15:31.288-0500 Error: Role a@test not found at src/mongo/shell/db.js:1373
      rs0:SECONDARY> db.getRoles()
      [ ]
      rs0:SECONDARY> db.getUser('a')
      2014-01-31T14:19:37.017-0500 Error: User a@test not found at src/mongo/shell/db.js:1253
      rs0:SECONDARY> db.getUsers()
      [ ]
      
      Show
      Start a replica set, it will run with read preference Primary by default. Connect with the shell to the secondary: rs0:SECONDARY> db.getRole( 'a' ) 2014-01-31T14:15:31.288-0500 Error: Role a@test not found at src/mongo/shell/db.js:1373 rs0:SECONDARY> db.getRoles() [ ] rs0:SECONDARY> db.getUser( 'a' ) 2014-01-31T14:19:37.017-0500 Error: User a@test not found at src/mongo/shell/db.js:1253 rs0:SECONDARY> db.getUsers() [ ]

      It is possible to successfully run the commands usersInfo and rolesInfo on a secondary without setting slaveOk=true in the command.

      That is, the command's corresponding slaveOk() virtual functions are returning true when they should return false. When changing slaveOk() also implement slaveOverrideOk() to return true for these commands so that specifying slaveOk=true in the command will be honored.

            Assignee:
            andreas.nilsson Andreas Nilsson
            Reporter:
            andreas.nilsson Andreas Nilsson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: