summaryrefslogtreecommitdiff
path: root/buildscripts
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 15:31:12 +0000
commit42669a4ef257f5522ecb63709feed49f0e7e6b78 (patch)
tree3c4318514ba3d4aadbef578863eddc5dfa17c9ab /buildscripts
parentb82d718c176b5d9837b9ec88cd9d1983e1e9820c (diff)
downloadmongo-42669a4ef257f5522ecb63709feed49f0e7e6b78.tar.gz
SERVER-56938 Continuous tenant migration hook should retry dropping tenant dbs on write concern errors
Diffstat (limited to 'buildscripts')
-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(