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

new Mongo() connections to replica sets does not appear to be independent

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 3.0.3
    • Shell
    • None
    • ALL
    • Hide

      1. Create a replica set ONE, with authentication user ONE, password FOO, hosted on hosts: host1, host2, host3
      2. Create a second replica set TWO, with authentication user TWO, password BAR, on host4, host5, host6
      3. In the mongo shell (--nodb), attempt to interact with both of them at the same time, such as:

      var c_one = new Mongo( 'ONE/host1,host2,host3' );
      var c_two = new Mongo( 'TWO/host4,host5,host6' );

      var db_one = c_one.getDB('someDB');
      db_one.auth( 'ONE', 'FOO' );

      var db_two = c_two.getDB('someOtherDB');
      db_two.auth( 'TWO', 'BAR' );

      The attempt to authenticate to db_two will fail.
      Change only the order of declaration of c_one and c_two, and run it again, and the authentication to db_one will fail, and the authentication to db_two will succeed.

      Show
      1. Create a replica set ONE, with authentication user ONE, password FOO, hosted on hosts: host1, host2, host3 2. Create a second replica set TWO, with authentication user TWO, password BAR, on host4, host5, host6 3. In the mongo shell (--nodb), attempt to interact with both of them at the same time, such as: var c_one = new Mongo( 'ONE/host1,host2,host3' ); var c_two = new Mongo( 'TWO/host4,host5,host6' ); var db_one = c_one.getDB('someDB'); db_one.auth( 'ONE', 'FOO' ); var db_two = c_two.getDB('someOtherDB'); db_two.auth( 'TWO', 'BAR' ); The attempt to authenticate to db_two will fail. Change only the order of declaration of c_one and c_two, and run it again, and the authentication to db_one will fail, and the authentication to db_two will succeed.

    Description

      When I create multiple variables holding database connections, each with separate and distinct authentication credentials, which ever one I connect to second, I am unable to authenticate to. In my case, the database connections are both replica sets, though I do not know if that matters.

      The shell SEEMS to be connecting to the different replica sets. However, something is not right because when I try to authenticate to the second one, it always fails. If I reverse the connection order, then the database that fails to authenticate reverses. There is not a credential problem. And it is not the order in which I authenticate, it is the order in which I connect.

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            jarrowwx John Arrowwood
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: