[SERVER-46370] Correctly maintain receiving chunks list after shard key refine Created: 24/Feb/20  Updated: 29/Oct/23  Resolved: 27/Mar/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.4.0-rc0, 4.7.0

Type: Bug Priority: Major - P3
Reporter: Jack Mulrow Assignee: Matthew Saltz (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-46386 Refining a shard key may lead to an o... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Sharding 2020-03-09, Sharding 2020-03-23, Sharding 2020-04-06
Participants:

 Description   

For the non-resumable range deleter protocol, shards track chunks currently being received in a migration in an in-memory map, removing the range when the migration succeeds or fails. There are at least two places where a refine during a migration (which can only happen if a migration runs without the distributed lock) can lead a range to incorrectly remain in this list after the migration aborts:

  1. When setting new filtering metadata in the MetadataManager, we clear entries from the receiving chunks list that overlap with the new metadata. This comparison goes through the ChunkManager, which uses key strings to compare ranges, which doesn't work correctly for ranges with different numbers of fields, like after a refine.
  2. In MigrationDestinationManager::_forgetReceive(), we don't remove a chunk from the receiving range list if the epoch has changed. If there's a refine during the migration, this won't be correct and we may fail to clear the received range from receiving chunks.


 Comments   
Comment by Githook User [ 01/Apr/20 ]

Author:

{'name': 'Matthew Saltz', 'email': 'matthew.saltz@mongodb.com', 'username': 'saltzm'}

Message: SERVER-46370 Maintain _receivingChunks list correctly after shard key refine

(cherry picked from commit c5eea7753b2fe3082d853ff9400117c85ac42dab)
Branch: v4.4
https://github.com/mongodb/mongo/commit/f088b63424736855b103bb0e4f6618837df0e4f9

Comment by Githook User [ 26/Mar/20 ]

Author:

{'name': 'Matthew Saltz', 'username': 'saltzm', 'email': 'matthew.saltz@mongodb.com'}

Message: SERVER-46370 Maintain _receivingChunks list correctly after shard key refine
Branch: master
https://github.com/mongodb/mongo/commit/c5eea7753b2fe3082d853ff9400117c85ac42dab

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