-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
When modern retryable reads were implemented in https://jira.mongodb.org/browse/RUBY-1562, there was a compatibility issue with existing Mongoid query cache code (which copied a portion of the driver's cursor implementation). This was fixed in https://github.com/mongodb/mongo-ruby-driver/pull/1348 by having the driver accept the Mongoid no-argument invocation of read_with_retry. Unfortunately when this happens, the driver uses the legacy read retry mechanism even if the modern mechanism is configured.
The driver contains the following note in a comment:
# Older versions of Mongoid call read_with_retry without arguments. # This is already not correct in a MongoDB 3.6+ environment with # sessions. For compatibility we emulate the legacy driver behavior # here but upgrading Mongoid is strongly recommended.
However, as far as I can see the respective Mongoid change was never implemented.
Either Mongoid needs to be updated to invoke the driver correctly, such that modern retryable reads are used, or query cache implementation needs to be moved into the driver.
In the mean time, https://jira.mongodb.org/browse/RUBY-1986 will allow seamless handling of "node shutting down" errors in applications that are using old versions of Mongoid but modern Ruby driver.