summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2021-05-14 00:39:09 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-14 19:55:18 +0000
commitedb09ebe3bc8e0513500e1584df562cd5476eb53 (patch)
tree0d71f5720210df9d7d34415b3a4cd4193b61eab8
parent558a073c770f0af215d5aff60259cc73fdc31d03 (diff)
downloadmongo-edb09ebe3bc8e0513500e1584df562cd5476eb53.tar.gz
SERVER-56938 Continuous tenant migration hook should retry dropping tenant dbs on write concern errors
(cherry picked from commit 42669a4ef257f5522ecb63709feed49f0e7e6b78)
-rw-r--r--buildscripts/resmokelib/testing/hooks/tenant_migration.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/buildscripts/resmokelib/testing/hooks/tenant_migration.py b/buildscripts/resmokelib/testing/hooks/tenant_migration.py
index 33c95b59738..285c9683fe6 100644
--- a/buildscripts/resmokelib/testing/hooks/tenant_migration.py
+++ b/buildscripts/resmokelib/testing/hooks/tenant_migration.py
@@ -662,10 +662,14 @@ class _TenantMigrationThread(threading.Thread): # pylint: disable=too-many-inst
if db_name.startswith(self._tenant_id + "_"):
primary_client.drop_database(db_name)
return
- except (pymongo.errors.AutoReconnect, pymongo.errors.NotMasterError):
+ # We retry on all write concern errors because we assume the only reason waiting for
+ # write concern should fail is because of a failover.
+ except (pymongo.errors.AutoReconnect, pymongo.errors.NotMasterError,
+ pymongo.errors.WriteConcernError) as err:
primary = get_primary(rs, self.logger)
- self.logger.info("Retrying dropDatabase commands against primary on port %d.",
- primary.port)
+ self.logger.info(
+ "Retrying dropDatabase commands against primary on port %d after error %s.",
+ primary.port, str(err))
continue
except pymongo.errors.PyMongoError:
self.logger.exception(