-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 2.0.4
-
Component/s: Private API
-
None
Setting cursor flags on a cursor doesn't result in those flags making it to the query, because ReadPreferable clobbers them in update_options:
My fix preserves any cursor flags that have been set, allowing them to actually make it to the server.
def update_options(context) if context.slave_ok? || (!context.mongos? && read.slave_ok?) options.dup.tap do |opts| (opts[:flags] ||= []) << :slave_ok end else options end end