Skip to content
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

Stop ensure_indexes running on a secondaries #555

Closed
rozza opened this issue Jan 24, 2014 · 1 comment
Closed

Stop ensure_indexes running on a secondaries #555

rozza opened this issue Jan 24, 2014 · 1 comment
Milestone

Comments

@rozza
Copy link
Contributor

rozza commented Jan 24, 2014

As it will fail!

@DavidBord
Copy link
Contributor

I think that a more robust solution would be something like:
if not collection.is_mongos and collection.read_preference > 1:
return
because otherwise connections to a mongos and not a mongod won't ensure indices at all

I know it is way bigger than the scope of this issue, but this is one of the moments that I would like to have a log message saying that no indices were created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants