[SERVER-34447] Deduplicate concurrent chunk split requests for the same chunk Created: 12/Apr/18  Updated: 25/Jun/18  Resolved: 25/Jun/18

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

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

Issue Links:
Depends
depends on SERVER-35612 Implement ChunkWritesTracker to track... Closed
Duplicate
duplicates SERVER-35612 Implement ChunkWritesTracker to track... Closed
Sprint: Sharding 2018-06-04, Sharding 2018-06-18, Sharding 2018-07-02
Participants:

 Description   

With the new autosplitting design, a thread pool is used to asynchronously execute chunk splits. This can lead to scenarios where, for example, a request to split one chunk is submitted, more writes come in, and another request to split the same chunk is submitted before the first is executed. Those two tasks could then either be executed concurrently or sequentially. This can lead to:

  • Potentially duplicated work, if two threads concurrently process conflicting work corresponding to the same chunk, and only one succeeds
  • If you’re loading a lot into a chunk that’s currently being split you could end up with the task list growing large until the chunk is split, followed by a bunch of useless work when the chunk is finally split
  • Almost unbounded growth of the task queue, if your splitting can't keep up with writes

One solution to this is to keep track of which chunks have split tasks currently pending/executing, and when a new task is submitted it should be checked against the list of pending tasks. If it corresponds to the same chunk as a currently executing task, it should return silently without doing any work.



 Comments   
Comment by Githook User [ 18/Jun/18 ]

Author:

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

Message: SERVER-34447 Basic cleanup of trySplitting
Branch: master
https://github.com/mongodb/mongo/commit/f74754a013d3a41ed7477dcf4854798f0f7e29ad

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