[SERVER-11683] Figure out mongod split triggering mechanism Created: 13/Nov/13  Updated: 02/Aug/18  Resolved: 13/Nov/13

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

Type: Task Priority: Major - P3
Reporter: Greg Studer Assignee: Randolph Tan
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-10866 Figure out split triggering mechanism Closed
Participants:

 Description   

Plan for 2.6:
Wire existing logic to the write commands in mongos while preserving previous behaviour as much as possible.

Plan for beyond 2.6:
Move auto split mechanism to the shards. A separate entity will be tasked to keep track of the document sizes being inserted. This entity will have no knowledge of the entire chunk ranges and config for a collection and will only know ranges being fed to it. Basically, the api would look something like:

class AutoSplitTracker {
public:
  bool newDoc(const BSONObj& minChunkKey, const BSONObj& maxChunkKey, const BSONObj& doc) {
    // Check inconsistency in mix/max pair with our own map and delete inconsistent entries.
    // Inconsistent entries are caused by the changes in chunk boundaries due to the chunks being merged or splitted.
 
    _map[minChunkKey].increment(doc.objsize());
 
    if (_map[minChunkKey].size() > splitThreshold) {
       // use splitVector to determine if we actually need to split
    }
  }
}


Generated at Thu Feb 08 03:26:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.