diff options
| author | jannaerin <golden.janna@gmail.com> | 2021-01-26 19:41:17 +0000 |
|---|---|---|
| committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-01-27 18:43:58 +0000 |
| commit | cee8be71cf1a9b4fa914cdaa8adb8d08818c1c8a (patch) | |
| tree | fbe3c5da3e261a91623eec93f04bfd89a4cf9f27 | |
| parent | 699c25860f4811d661a32ffab56f17b4797cd16e (diff) | |
SERVER-54041 ReshardingOplogApplicationRules::applyOperation() doesn't retry on WriteConflictExceptions
| -rw-r--r-- | src/mongo/db/s/resharding/resharding_oplog_application.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/s/resharding/resharding_oplog_application.cpp b/src/mongo/db/s/resharding/resharding_oplog_application.cpp index e97965d5dad..9dae51b0937 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_application.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_application.cpp @@ -176,9 +176,11 @@ Status ReshardingOplogApplicationRules::applyOperation( wuow.commit(); return Status::OK(); - } catch (const ExceptionFor<ErrorCodes::LockTimeout>&) { - throw WriteConflictException(); } catch (const DBException& ex) { + if (ex.code() == ErrorCodes::WriteConflict || ex.code() == ErrorCodes::LockTimeout) { + throw WriteConflictException(); + } + return ex.toStatus(); } }); |
