Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force commands to use primary read preference #181

Closed
jmikola opened this issue Jul 6, 2017 · 0 comments
Closed

Force commands to use primary read preference #181

jmikola opened this issue Jul 6, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@jmikola
Copy link
Contributor

jmikola commented Jul 6, 2017

While investigating #180, I came across some undocumented behavior in the legacy mongo extension that enforces a primary read preference in php_mongo_runcommand(). The php_mongo_command_supports_rp() helper only respects the MongoDB instance's read preference for teh following commands:

  • count
  • group
  • dbStats
  • geoNear
  • distinct
  • aggregate
  • collStats
  • geoSearch
  • mapreduce and mapReduce (case-sensitive reasons)
  • parallelCollectionScan

Note that aggregate does not check for write variations that would output to a collection; however, mapReduce does check for { out: { inline: 1}}. For that reason, a fix for Doctrine MongoDB may not be warranted, since its query builder does not support aggregate. It's possible that it may require a fix for the aggregation builder, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants