christkv/node-mongodb-native — Issue #472: Replicaset problem
Author: curtisc
Created: 2012-01-09 06:26:28+00:00
State: open

I've been trying to test replicaset failover, and it seems to work when there's not much load, but once I start throwing a ton of inserts at the replicaset and killing the primary, I get the following error:

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Uncaught, unspecified 'error' event.
at [object Object].emit (events.js:50:15)
at [object Object]. (/Users/curtisc/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:101:15)
at [object Object].emit (events.js:70:17)
at Socket. (/Users/curtisc/node_modules/mongodb/lib/mongodb/connection/connection.js:407:10)
at Socket.emit (events.js:67:17)
at Array.0 (net.js:313:25)
at EventEmitter._tickCallback (node.js:192:40)

When I do one insert per second or 10 per second it works fine and properly reconnects to the new primary and continues on its merry way. But once I increase it to 100 per second that crash tends to happen. What's interesting is that new inserts continue to work with the new PRIMARY, it's just once the retries start retrying is when it fails (extending the retryMiliseconds delays it happening). Perhaps a problem with connection pooling? I've tried it with auto_reconnect both on and off, as well as increasing the pool size. I'm still digging in and debugging but thought I'd report it here in case I'm missing something obvious