-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.6.2
-
Component/s: None
-
None
-
Environment:Ubuntu 16.04
-
(copied to CRM)
related to https://jira.mongodb.org/browse/RUBY-1312 we are still facing some problems with no_timeout queries.
it seemed resolved with version 3.6.6 of mongodb, but now randomly happens again that a cursor is not found during an iteration:
.rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/operation/result.rb:267:in `raise_operation_failure': cursor id 118503151257 not found (43) (Mongo::Error::OperationFailure)
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/operation/result.rb:263:in `validate!'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/operation/get_more/op_msg.rb:47:in `execute'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/operation/get_more.rb:33:in `execute'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/cursor.rb:242:in `block in get_more'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/retryable.rb:45:in `read_with_retry'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/cursor.rb:241:in `get_more'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/cursor.rb:124:in `each'
from .rvm/gems/ruby-2.4.3/gems/mongo-2.6.2/lib/mongo/collection/view/iterable.rb:45:in `each'
from .rvm/gems/ruby-2.4.3/gems/mongoid-7.0.2/lib/mongoid/query_cache.rb:222:in `each'
from .rvm/gems/ruby-2.4.3/gems/mongoid-7.0.2/lib/mongoid/contextual/mongo.rb:133:in `each'
from .rvm/gems/ruby-2.4.3/gems/mongoid-7.0.2/lib/mongoid/contextual.rb:20:in `each'
the issue manifest only with ruby driver version > 2.5 (since it's using the new sessions) with mongo driver 2.4 it does not happen.
I'm trying to write a test case to reproduce the issue but still no luck. it seems that the cursor is killed in a non deterministic manner.
I don't know if the issue is still related to the time between two getMore command or not... I will update the ticket if I find the correct test to reproduce it.
by the way, if a query is created with no_timeout option it should never be killed disregarding how much it takes to get more data from it... we have a lot of long running tasks that depends on this particular feature and now (after upgrading to mongoid 7.0.x and mongo 2.6.x) they are randomly failing.
best regards.
- related to
-
DRIVERS-1602 Automate session refresh for long-lived cursors
- Backlog