mgo
mgo copied to clipboard
Not checking "not master" and "node is recovering" errors
During compact of one of our secondaries I noticed that there was period of few seconds when queries would return error "node is recovering".
Checking mongo specification on server discovery and monitoring I noticed part about handling those kinds of errors as seen here.
Multi-threaded and asynchronous clients MUST request an immediate check of the server. Unlike in the "network error" scenario above, a "not master" or "node is recovering" error means the server is available but the client is wrong about its type, thus an immediate re-check is likely to provide useful information.
Checking through the code I don't think that this type of check is currently implemented which can result in above mentioned behaviour.
Hi @IvanVlasic
Can you provide an example to reproduce this behaviour? Moreover, contributions are welcomed, so it would be great if you are willing to open a PR!
Best regards, Oscar
Hello @maitesin, thanks for getting back to me.
I will try to write some tests and possibly open a PR once I get some free time for this.