diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-03-25 11:41:00 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2016-03-25 11:46:51 -0400 |
commit | 178e241b81882f85a58deda960d80607a77e1c3a (patch) | |
tree | d17217e4355c6a9c3a404c0a352912e9616f8b64 /src/mongo/db/exec/update.h | |
parent | 4a38dcf183c1024b41f9d68b0ca8e2f885f1e669 (diff) | |
download | mongo-178e241b81882f85a58deda960d80607a77e1c3a.tar.gz |
SERVER-22178 Always retry sorted findAndModify upon write conflict.
Previously, if there was a WriteConflictException while actually doing
the update or delete, we would retry the findAndModify, but if the
update or delete stage detected that the document was already deleted
or that it no longer matched the predicate, it would not retry. This
patch ensures the findAndModify will be retried in either of those
scenarios.
Diffstat (limited to 'src/mongo/db/exec/update.h')
-rw-r--r-- | src/mongo/db/exec/update.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/exec/update.h b/src/mongo/db/exec/update.h index 263c28ab8e5..0fa391c778f 100644 --- a/src/mongo/db/exec/update.h +++ b/src/mongo/db/exec/update.h @@ -176,6 +176,12 @@ private: */ Status restoreUpdateState(); + /** + * Stores 'idToRetry' in '_idRetrying' so the update can be retried during the next call to + * work(). Always returns NEED_YIELD and sets 'out' to WorkingSet::INVALID_ID. + */ + StageState prepareToRetryWSM(WorkingSetID idToRetry, WorkingSetID* out); + UpdateStageParams _params; // Not owned by us. |