[JAVA-1921] getStats() helper should respect DBCollection read preference Created: 07/Aug/15  Updated: 14/Sep/15  Resolved: 14/Aug/15

Status: Closed
Project: Java Driver
Component/s: Command Operations
Affects Version/s: 3.0.3
Fix Version/s: 3.0.4, 3.1.0

Type: Bug Priority: Minor - P4
Reporter: Luke Lovett Assignee: Jeffrey Yemin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

The getStats() helper on DBCollection always uses the "primary" read preference, regardless of what read preference is set on the underlying collection. According to the server selection spec, the collStats command may use a "secondary" read preference: https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst#use-of-read-preferences-with-commands

This bug only affects the 3.0 version of the Java driver.



 Comments   
Comment by Jeffrey Yemin [ 14/Sep/15 ]

Fix release today in 3.0.4.

Comment by Githook User [ 14/Aug/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Changed DBCollection.getStats to use the collection's default read preference, as per the server selection specification.

JAVA-1921
Branch: 3.0.x
https://github.com/mongodb/mongo-java-driver/commit/79cb423d372a04cf01fa5cb2fc9b3e3759280167

Comment by Githook User [ 14/Aug/15 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: Changed DBCollection.getStats to use the collection's default read preference, as per the server selection specification.

JAVA-1921
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/ab39ff43ca20393da8e97c8a3227fd3329be3cd4

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