fix(MongoDB): Driver does not retry on AutoReconnect errors
When a primary MongoDB node fails over to a secondary, pymongo raises an
AutoReconnect error. Let's catch that and retry the operation so that
we truly are Highly Available (in the sense that the user will never notice
the few ms of "downtime" caused by a failover).
This is particularly important when hosting backend with a DBaaS that
routinely fails over the master as a way of compacting shards.
NOTE: In order to get all MongoDB tests green, a tiny unrelated bug in
test_shards was fixed as part of this patch.
Reviewed: https:/ /review. openstack. org/75165 /git.openstack. org/cgit/ openstack/ marconi/ commit/ ?id=c13fb6f93eb a49f88d88820d0c 06b3d4be89d558
Committed: https:/
Submitter: Jenkins
Branch: master
commit c13fb6f93eba49f 88d88820d0c06b3 d4be89d558
Author: kgriffs <email address hidden>
Date: Thu Jan 30 11:09:31 2014 -0600
fix(MongoDB): Driver does not retry on AutoReconnect errors
When a primary MongoDB node fails over to a secondary, pymongo raises an
AutoReconnect error. Let's catch that and retry the operation so that
we truly are Highly Available (in the sense that the user will never notice
the few ms of "downtime" caused by a failover).
This is particularly important when hosting backend with a DBaaS that
routinely fails over the master as a way of compacting shards.
NOTE: In order to get all MongoDB tests green, a tiny unrelated bug in
test_shards was fixed as part of this patch.
Closes-Bug: 1214973 a0bbb8fdcebda9e 985d1e49714
Change-Id: Ibf172e30ec6e7f