[JAVA-301] Replicaset w/auth warnings too verbose when not auth'd against local/admin db Created: 19/Mar/11  Updated: 23/Mar/11  Resolved: 21/Mar/11

Status: Closed
Project: Java Driver
Component/s: Cluster Management
Affects Version/s: 2.5
Fix Version/s: 2.5.1

Type: Bug Priority: Minor - P4
Reporter: Scott Hernandez (Inactive) Assignee: Scott Hernandez (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The is too verbose. It should not log every time this comes up.

This seems to only be important in checking the replset name to make sure it is the name expected; in this case I think this msg should be moved to "info" level, or only printed once.

In fact, this should just get the setName from isMaster and there won't be an auth problem at all (until we need to check something more):

test:PRIMARY> db.runCommand("isMaster")
{
"setName" : "test",
"ismaster" : true,
"secondary" : false,
"hosts" : [
"stump:2003",
"stump:2002",
"stump:2001"
],
"maxBsonObjectSize" : 16777216,
"ok" : 1
}



 Comments   
Comment by Antoine Girbal [ 22/Mar/11 ]

so the reason why it wasnt using isMaster before is that until mongodb 1.7 replset name is not included in isMaster output.
This means that people still using 1.6 with 2.5 driver will not pick up replset name.
I dont think it's a big deal since it doesnt do much with it, it just prints a warning in log if the repl set name changes.

Comment by Scott Hernandez (Inactive) [ 21/Mar/11 ]

I changed to use isMaster so it will not log and doesn't require authentication to admin/local.

Comment by auto [ 21/Mar/11 ]

Author:

{u'login': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}

Message: JAVA-301: fix check to use isMaster for replSet name
https://github.com/mongodb/mongo-java-driver/commit/8ecffdabe0af719fcc74d68e73d095380aa40541

Generated at Thu Feb 08 08:51:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.