[SERVER-39141] The range deleter should retry on write conflict exceptions Created: 22/Jan/19  Updated: 29/Oct/23  Resolved: 10/Jun/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.2.0-rc3, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Jack Mulrow Assignee: Alexander Taskov (Inactive)
Resolution: Fixed Votes: 0
Labels: open_todo_in_code, todo_in_code
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-38972 mongos takes forever for multi shard ... Closed
related to SERVER-43518 Complete TODO listed in SERVER-39141 Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Sharding 2019-02-25, Sharding 2019-06-03, Sharding 2019-06-17
Participants:

 Description   

The range deleter deletes orphan documents by constructing a PlanExecutor with a YIELD_MANUAL yield policy. Because of this, any write conflict errors encountered will be re-thrown, but there is no WriteConflictRetry loop in CollectionRangeDeleter::cleanUpNextRange, causing post-migration orphan cleanup and cleanupOrphaned commands to fail unnecessarily.

The net effect of this is that more orphans remain on the system.



 Comments   
Comment by Githook User [ 13/Feb/20 ]

Author:

{'username': 'alextaskov', 'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com'}

Message: SERVER-43518 Complete TODO listed in SERVER-39141
Branch: master
https://github.com/mongodb/mongo/commit/66002c604a9a2cd9c419bad318db0252f576dbd8

Comment by Githook User [ 10/Jun/19 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-39141 Handle WriteConflictException in range deleter

(cherry picked from commit ece39c7650b76a45ee2357dc4a7adb2ab195eda4)
Branch: v4.2
https://github.com/mongodb/mongo/commit/ba4d91f29e8fddb7c71ffdcaa3e73aec67511f36

Comment by Githook User [ 10/Jun/19 ]

Author:

{'name': 'Alex Taskov', 'email': 'alex.taskov@mongodb.com', 'username': 'alextaskov'}

Message: SERVER-39141 Handle WriteConflictException in range deleter
Branch: master
https://github.com/mongodb/mongo/commit/ece39c7650b76a45ee2357dc4a7adb2ab195eda4

Comment by Kaloian Manassiev [ 04/Feb/19 ]

Ah, that makes sense, thanks Jack! I removed the 3.6 and 4.0 links.

Comment by Jack Mulrow [ 04/Feb/19 ]

kaloian.manassiev, I'm not sure this affects 4.0 and 3.6. On both of those branches it looks like the deletes are in a WriteConflictRetryLoop: 4.0 and 3.6.

SERVER-38179 recently changed how the range deleter deletes orphans (removing the retry loop in favor of using InternalPlanner::deleteWithIndexScan), so I think this is only a problem in master.

Generated at Thu Feb 08 04:51:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.