-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reconnection issue #3583
Comments
When the mongod restarts, it can take a few seconds for it to realize that it's a primary. Is this error a temporary condition or does it persist? |
@vkarpov15 - From what I am noticing, after mongod restarts, if the next write request happens after 4 to 5 seconds, I do NOT see this crash. But if the next write request happens very soon within a second or so - crash! My webapp has heavy traffic load which means the next write op can happen within a second. To further this question:
|
Also, which version of mongoose are you using? This looks like an old version. |
@vkarpov15 I am on version 3.8.9 |
I remember there being some related issues fixed in subsequent 3.8 releases. Could you upgrade to 3.8.37 and see if the issue still happens? |
I have mongodb setup as standalone server. I also have replicaset enabled as standalone for enabling the oplog (my app tracks realtime updates).
When mongod service is stopped and restarted mongoose auto-reconnects but throws an error when performing write operation. (I understand mongodb cannot write to secondary but I just have one node which is PRIMARY but mongoose thinks its secondary?
d:\project\node_modules\mongoose\node_modules\mongodb\lib\mongodb\db.js:18
67
if(!connection.isCompatible()) {
^
TypeError: Object Error: Cannot write to a secondary has no method 'isCompatible
The text was updated successfully, but these errors were encountered: