Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-370

Setting a node as Hidden doesn't propagate to C# drivers

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.4
    • Affects Version/s: 1.3.1
    • Component/s: None
    • None
    • Environment:
      Windows 7 x64

      While running an application, if you set a replica node as hidden before the thread the application is running on exits, the node will still be listed as a viable secondary.

      Steps to reproduce:

      • Create a MongoDB replica set with at least one server on port 27019
      • Run the code here https://gist.github.com/56ca0ad073ed7f2be257
      • While the code is running you should see output of the current secondaries it knows about
      • While the code is running still, connect to the primary MongoDB node and run...
      • rs.status()
      • Find a secondary node and take note of its index (I used 1)
      • config = rs.conf()
      • config.members[1].priority = 0
      • config.members[1].hidden = true
      • rs.reconfig(config)

      This will set member 1 to be now hidden. However the application can still see it as a viable secondary as seen by the application output. If you re run the application you will see it's missing from the list of secondary candidates, as it should be.

      If you were to take the server offline completely while the app is running you'll see it gets removed from the list of viable secondaries. You can also call server.Reconnect() and this will update the list correctly.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            chadmoran Chad Moran
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: