[SERVER-54631] Submit range deletion tasks upon sharded collection rename Created: 19/Feb/21  Updated: 29/Oct/23  Resolved: 04/Mar/21

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

Type: Bug Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: PM-1965-Milestone-0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

On SERVER-54132 we realized that the orphans check at the end of the tests was not running due to this check for {dropped: false}. As this was fixed, it was uncovered that rename_sharded.js had orphans left around. 

It happens when the rename runs after a move chunk that has not yet executed the range deletion. Temporarily, we changed the moveChunk to {waitForDelete: true} in the test.

Chosen approach (executed locally on each shard):

Precondition: moveChunks are blocked

  • Get a list of source collection's persistent range deletion tasks
  • Rename source collection to target
  • Update _id (random) and nss (target) in the entries of the previously initialized list
  • Persist range deletions tasks for the target collection

This is safe because:

  • The SubmitRangeDeletionHandler observer will submit the new tasks to the range deleter
  • Old tasks referring the source collection will be discarded by the range deleter because the namespace was dropped


 Comments   
Comment by Githook User [ 04/Mar/21 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-54631 Submit range deletion tasks upon sharded collection rename
Branch: master
https://github.com/mongodb/mongo/commit/5090027fadbd3c552b281ec84ca45cdfc89f6828

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