[SERVER-57195] Convert resharding document deletion to use PersistentTaskStore instead of creating a WriteUnitOfWork Created: 25/May/21  Updated: 09/Jun/21  Resolved: 09/Jun/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Blake Oler Assignee: Junhson Jean-Baptiste (Inactive)
Resolution: Won't Do Votes: 0
Labels: PM-234-M3, PM-234-T-autocommits, neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-54460 Resharding may delete the state docum... Closed
is related to SERVER-54610 Resharding writes to donor documents ... Closed
is related to SERVER-51606 Handle recovery from resharding donors Closed
is related to SERVER-55511 Handle recovery for resharding recipi... Closed
Sprint: Sharding 2021-06-14
Participants:
Story Points: 1

 Description   

We changed the document deletion to use a manual WriteUnitOfWork, since we needed to leverage the onCommit handler to fulfill the completion promise. This was a temporary solution to SERVER-54460. However, SERVER-54460 has been solved by instead adding setAlwaysInterruptAtStepDownOrUp to relevant opCtxs. We no longer need to onCommit handler.

As code cleanup we can convert resharding document deletion back to using the PersistentTaskStore, which uses fewer lines of code. 



 Comments   
Comment by Janna Golden [ 09/Jun/21 ]

Closing in favor of SERVER-54610.

Comment by Haley Connelly [ 09/Jun/21 ]

After chatting with max.hirschhorn about SERVER-54610, we decided that we take the MODE_X (instead of MODE_IX) collection lock for deleting the donor document. If the pin is set and resharding has to abort, deleting the donor document could also mean unsetting the pin  (which requires the MODE_X lock to prevent write skew).

Generated at Thu Feb 08 05:41:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.