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

Implement support for read preferences and use separate Cursor property for ODM's UoW hints #565

Merged
merged 17 commits into from
Dec 2, 2013

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Apr 22, 2013

This PR will require:

  • Merge Internal cursor improvements for hint, sort, RP and recreation mongodb#105, which separates MongoCursor hints from the Cursor property used for ODM hints
  • Implement read preference support in doctrine/mongodb's query builder
  • Tag a stable 1.1.x release of doctrine/mongodb
  • Implement read preference support in ODM's query builder
  • Extend ODM hints to support read preferences (for consistency between queries/cursors and PersistentCollections)

@ghost ghost assigned jmikola Apr 22, 2013
jmikola referenced this pull request in doctrine/mongodb Apr 30, 2013
Successive calls to MongoCursor::hint() or sort() will overwrite the previous value, so there is no reason to store multiple values in the Doctrine class. ODM does seem to depend on the hints property to track UnitOfWork hints (entirely different than MongoDB index usage hints), but that should be changed upstream.
@jmikola
Copy link
Member Author

jmikola commented Apr 30, 2013

@jsnoop36
Copy link

@jmikola has any progress been made on this in the past three months? We would really appreciate having support for readPreference at the query builder level and may write it ourselves if no progress has been made. Is this still the current state of this story? If so, is there anything we can do to help?

@jmikola
Copy link
Member Author

jmikola commented Jul 31, 2013

The checklist above is correct; I haven't made any progress on this, but the next step is adding support to doctrine/mongodb before upgrading ODM to work with 1.1.x.

@jmikola jmikola mentioned this pull request Aug 15, 2013
@bkorsunsky
Copy link

@jmikola any updates on progress for this issue? Thanks!

@jmikola
Copy link
Member Author

jmikola commented Oct 31, 2013

Read preference support in doctrine/mongodb is in progress here: doctrine/mongodb#143

This depends on doctrine/mongodb#105 being merged into a stable 1.1.x release of doctrine/mongodb.
Handle ArrayIterator results for commands, fix geospatial tests, and use array argument for notIn() method.
Updated the constructor signatures for Cursor, Builder, and Query classes. See: doctrine/mongodb@39a2b7c#diff-10

ODM's LoggableCursor class only served to log sort() calls with unprepared field names. The wrapped LoggableCursor already logs its own sort() call (with prepared field names).
See: doctrine/mongodb@39a2b7c
EagerCursor::next() will now return nothing, which conforms to the Iterator interface.
Set the cursor hint after calling the base method (likewise for the slaveOkay() method)
Create UoW hints property, and use that to store refresh, slaveOkay, and read preference hints. Replace cursor-wrapping in Query::execute() with logic in prepareCursor().
The previous assertions were too fragile, as they would fail if another hint was present in the array. Changed the assertions to only consider the slaveOkay hint.
jmikola added a commit that referenced this pull request Dec 2, 2013
Implement support for read preferencesUse separate Cursor property for ODM's UoW hints
@jmikola jmikola merged commit f65e504 into master Dec 2, 2013
@jmikola jmikola deleted the read-preferences branch December 2, 2013 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants