diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2018-12-26 15:07:59 -0500 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2018-12-26 15:07:59 -0500 |
commit | 62c7e599ba211209eb93ae8f652d17fc8f6c251f (patch) | |
tree | 98b5c7fea74ea0aace51164634f5f9bdc5dc7b7b /jstests | |
parent | f7089e3b12fc79adb583a031da87fed14cc6fc35 (diff) | |
download | mongo-62c7e599ba211209eb93ae8f652d17fc8f6c251f.tar.gz |
SERVER-36751 Skip retrying dropDatabase on DatabaseDropPending error.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/libs/override_methods/implicitly_retry_on_database_drop_pending.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/libs/override_methods/implicitly_retry_on_database_drop_pending.js b/jstests/libs/override_methods/implicitly_retry_on_database_drop_pending.js index f8f8989a4ad..c605f9336d6 100644 --- a/jstests/libs/override_methods/implicitly_retry_on_database_drop_pending.js +++ b/jstests/libs/override_methods/implicitly_retry_on_database_drop_pending.js @@ -142,6 +142,18 @@ // yet have generated the oplog entry for the "dropDatabase" operation while it is // dropping each intermediate collection. awaitLatestOperationMajorityConfirmed(conn); + + if (TestData.skipDropDatabaseOnDatabaseDropPending && + commandName === "dropDatabase") { + // We avoid retrying the "dropDatabase" command when another "dropDatabase" + // command was already in progress for the database. This reduces the likelihood + // that other clients would observe another DatabaseDropPending error response + // when they go to retry, and therefore reduces the risk that repeatedly + // retrying an individual operation would take longer than the 'defaultTimeout' + // period. + res = {ok: 1, dropped: dbName}; + return true; + } }, "timed out while retrying '" + commandName + "' operation on DatabaseDropPending error response for '" + dbName + "' database", |