Method: Mongo::Session#retry_reads?

Defined in:
lib/mongo/session.rb

#retry_reads?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Whether reads executed with this session can be retried according to the modern retryable reads specification.

If this method returns true, the modern retryable reads have been requested by the application. If the server selected for a read operation supports modern retryable reads, they will be used for that particular operation. If the server selected for a read operation does not support modern retryable reads, the read will not be retried.

If this method returns false, legacy retryable reads have been requested by the application. Legacy retryable read logic will be used regardless of server version of the server(s) that the client is connected to. The number of read retries is given by :max_read_retries client option, which is 1 by default and can be set to 0 to disable legacy read retries.

Returns:

  • (Boolean)

Since:

  • 2.5.0



200
201
202
# File 'lib/mongo/session.rb', line 200

def retry_reads?
  client.options[:retry_reads] != false
end