On 11/10/2012 01:58 PM, Hannes Magnusson wrote:
> I assume you managed to connect to the replicaset just fine,
Yes.
> it was just after some queries that you started getting that exception?
I'd been using the same replica set for *months* without ever seeing
these cursor timeouts. A couple things happened lately that may be related.
I recently upgraded all my MongoDB servers from 2.0.6 to 2.2.0, and
then, shortly after, to 2.2.1.
When I do these upgrades, I typically tear down the Amazon EC2 instance
the MongoDB server is running on and create a new one from scratch. It's
possible there was some network connectivity issues between the client
(Symfony2 app / PHP driver) and the MongoDB replica set.
I also upgraded Doctrine/MongoDB libs (see previous post for versions).
I think what I finally did to fix things was just restart every MongoDB
server, then restart every Symfony2 Apache server.
Related:
http://stackoverflow.com/questions/13318321/symfony2-app-mongodb-replica-set-failover-requires-apache-restart
(although I can't recall if these errors were near a failover event).
My wondering about the primary,secondary order in the connection string
was a long shot.
> Are you doing slaveOkay reads?
No.
> Do you have a log from mongodb from that time period?
The MongoDB server logs were empty around the time I was seeing the
errors (I use --quiet).
Sorry I didn't specify earlier, but these errors were showing up in the
Symfony2 application log, not the MongoDB server log. I assume these
errors were coming from the PHP driver.
Also see
http://stackoverflow.com/a/13259538/156060 , another possibly
related issue.