[CDRIVER-903] slaveOk bit not set when using hint to query a secondary directly Created: 02/Oct/15  Updated: 20/Oct/16  Resolved: 05/Apr/16

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.2-rc0, 1.4.0
Fix Version/s: 1.4.0, 1.3.0-beta0

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Done Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PHPC-441 slaveOk bit not set when using hint t... Closed
is depended on by CDRIVER-1188 Implement mongoc_cursor_set_hint() Closed
Related
related to CDRIVER-1872 mongoc_cursor_set_hint causes seconda... Closed

 Description   

Reopening to merge into 1.3 codebase on master.



 Comments   
Comment by Githook User [ 03/May/16 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: PHPC-689: Use mongoc_cursor_set_hint() for query/command execution

Test changes were necessary because mongoc_cursor_set_hint() forces the slaveOk flag (CDRIVER-903).
Branch: master
https://github.com/mongodb/mongo-php-driver/commit/e2209d50b88e01b57ee4271d96a5bd7e603c9e54

Comment by Githook User [ 05/Apr/16 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-903 mongoc_cursor_hint sets slaveOk
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/dba2ce10b3a61c689f85c1f4534b8b952a838fd9

Comment by Jeremy Mikola [ 01/Apr/16 ]

Re-opened, as this appears to have regressed in 1.4.0-dev. This is causing the tests for CDRIVER-1188 (PR #319) to fail.

I don't believe the regression is in 1.3.x, as we would have noticed this in the PHPC and HHVM driver test suites. That said, you may want to port the tests from CDRIVER-1188 back to 1.3.x to verify (swapping the set_hint method for a manual hint property assignment, of course).

Comment by Githook User [ 14/Oct/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: Merge remote-tracking branch 'upstream/r1.2'

  • upstream/r1.2:
    CDRIVER-932: Fix typo in tutorial
    1.2.0 Release
    set libbson submodule to 1.2.0
    update solaris install instructions
    NEWS entry for 1.2.0
    CDRIVER-903: Hinted cursors should still apply read prefs
    CDRIVER-754 update list of supported platforms
    CDRIVER-881 include libbson.xsl in distribution tarball
    Change field names in 'createIndexes' command to match documentation

Conflicts:
NEWS
doc/installing.page
src/libbson
src/mongoc/mongoc-client.c
src/mongoc/mongoc-collection.c
src/mongoc/mongoc-cursor-private.h
src/mongoc/mongoc-cursor.c
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/23038aba78edc7d4e1375d7e4e8fbd5efedbe409

Comment by Githook User [ 14/Oct/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-903: Hinted cursors should still apply read prefs

This fixes an issue with the slaveOk bit not being set when using hint to query
a secondary directly.

We introduce a new is_write_command property on the cursor (private API change)
to avoid setting the slaveOk bit on write commands.

Conflicts:
src/mongoc/mongoc-collection.c
src/mongoc/mongoc-cursor-private.h
src/mongoc/mongoc-cursor.c
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/5e4fa5ced838276fcbf0f49469d970455b2c68d6

Comment by Githook User [ 14/Oct/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: PHPC-441: slaveOk bit is now set on hinted secondary query

This was fixed by CDRIVER-903, which is included in libmongoc 1.2.0.
Branch: master
https://github.com/mongodb-labs/mongo-php-driver-prototype/commit/f50332911d4531bde93f0e3ba2cb86e64f60b0ec

Comment by Githook User [ 14/Oct/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-903: Hinted cursors should still apply read prefs

This fixes an issue with the slaveOk bit not being set when using hint
to query a secondary directly.

We introduce a new is_write_command property on the cursor (private API
change) to avoid setting the slaveOk bit on write commands.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/9981b813d658dee36f6627cef92db425bf334962

Comment by Githook User [ 13/Oct/15 ]

Author:

{u'username': u'jmikola', u'name': u'Jeremy Mikola', u'email': u'jmikola@gmail.com'}

Message: CDRIVER-903: Hinted cursors should still apply read prefs

This fixes an issue with the slaveOk bit not being set when using hint to query
a secondary directly.

We introduce a new is_write_command property on the cursor (private API change)
to avoid setting the slaveOk bit on write commands.

Conflicts:
src/mongoc/mongoc-collection.c
src/mongoc/mongoc-cursor-private.h
src/mongoc/mongoc-cursor.c
Branch: r1.2
https://github.com/mongodb/mongo-c-driver/commit/5e4fa5ced838276fcbf0f49469d970455b2c68d6

Comment by Jeremy Mikola [ 04/Oct/15 ]

https://github.com/mongodb/mongo-c-driver/pull/292

Generated at Wed Feb 07 21:10:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.