summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/update.h
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2016-03-25 11:41:00 -0400
committerCharlie Swanson <charlie.swanson@mongodb.com>2016-03-25 11:46:51 -0400
commit178e241b81882f85a58deda960d80607a77e1c3a (patch)
treed17217e4355c6a9c3a404c0a352912e9616f8b64 /src/mongo/db/exec/update.h
parent4a38dcf183c1024b41f9d68b0ca8e2f885f1e669 (diff)
downloadmongo-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.h6
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.