[JAVA-270] If authentication is on for a replica set, then most likely all writes will always fail once primary server dies Created: 11/Feb/11  Updated: 17/Mar/11  Resolved: 11/Feb/11

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5

Type: Bug Priority: Major - P3
Reporter: Antoine Girbal Assignee: Antoine Girbal
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

chechAuth is not included within block handling I/O errors of call() or say().
So the whole logic to switch over master does not apply.
If auth is on and the master stops responding, master will never switch and all read and write operations will always fail.
Even if included in the try/catch block, checkauth actually catches IOexception and throws MongoException.Network.



 Comments   
Comment by auto [ 16/Feb/11 ]

Author:

{u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}

Message: JAVA-270: If authentication is on for a replica set, then most likely all writes will always fail once primary server dies
https://github.com/mongodb/mongo-java-driver/commit/2c6eb7709f81cd42f73aebf4629344e6f4de7681

Comment by Antoine Girbal [ 11/Feb/11 ]

Methods implemented at the port level should throw the raw exceptions like IOException, so that the connector above can make appropriate decisions on how to handle.
The say() and call() method will now switch master correctly upon ioexception on checkauth.

Comment by Antoine Girbal [ 11/Feb/11 ]

checkAuth is only called in say() and call().
Proposed fix:

  • include checkAuth in main try/catch block
  • have checkAuth not catch its exceptions internally
Generated at Thu Feb 08 08:51:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.