Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-117

Can't get repl set status from arbiters

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4
    • Affects Version/s: 1.3, 1.4
    • Component/s: None
    • Labels:

      When we try to run an admin command such as replSetGetStatus on an arbiter, the node driver returns an error "Cannot write to an arbiter", despite the fact this is a read operation, not a write. The mongo shell is able to run `rs.status()` on the arbiter OK, so we know it is possible to run.

      I believe this is an error in lib/mongodb/connection/server.js in canCheckoutReader. The code says:

      {{
      var canCheckoutReader = function(self) {
      // We cannot write to an arbiter or secondary server
      if(self.isMasterDoc && self.isMasterDoc['arbiterOnly'] == true)

      { return new Error("Cannot write to an arbiter"); ... }}

      Which I believe means the node driver will never allow any read operations, admin or not, from an arbiter.

      This is a problem for us as we are using direct connections to each machine in the replset to do monitoring. We want to get what each machine thinks the status of the cluster is, but can't get any info from the arbiters.

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            nim Nick Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: