[SERVER-17070] Maxsize test not valid when running wiredTiger Created: 27/Jan/15  Updated: 06/Dec/22  Resolved: 12/Dec/16

Status: Closed
Project: Core Server
Component/s: Sharding, WiredTiger
Affects Version/s: 3.0.0-rc6
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jonathan Abrahams Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: 28qa, balancer, disabled-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Tested
tested by SERVER-15831 Enhanced top chunk auto split tests Closed
Assigned Teams:
Sharding
Operating System: ALL
Steps To Reproduce:

function getNumberOfChunks(configDB) {
    return configDB.chunks.count();
}
 
var st = new ShardingTest("maxSize", 2, 1, 1, {shards: 2, chunksize: 1, manualAddShard: true});
var dbName = "test";
var collName = "topchunk";
var db = st.getDB(dbName);
var coll = db[collName];
var configDB = st.s.getDB('config');
 
st.startBalancer();
db.adminCommand({configureFailPoint: 'skipBalanceRound', mode: 'alwaysOn'});
 
st.adminCommand({addshard: st.getConnNames()[0], maxSize: 5});
st.adminCommand({addshard: st.getConnNames()[1], maxSize: 1});
 
db.adminCommand({enableSharding: dbName});
db.adminCommand({movePrimary: dbName, to: 'shard0000'});
db.adminCommand({shardCollection: coll+"", key: {x: 1}});
 
db.adminCommand({split: coll+"", middle: {x: 1000}});
db.adminCommand({moveChunk: coll+"", find: {x: 1000}, to: 'shard0000'});
 
db.adminCommand({split: coll+"", middle: {x: 0}});
db.adminCommand({moveChunk: coll+"", find: {x: 0}, to: 'shard0001'});
 
db.printShardingStatus(true);
 
// Auto split on write to low top chunk
var largeStr = new Array(1000).join('x');
 
// Number of chunks before auto-split
var numChunks = getNumberOfChunks(configDB);
 
// Insert one doc at a time until first auto-split occurs on top chunk
var xval = 2000;
do {
        var doc = {x: xval, val: largeStr};
        coll.insert(doc);
        xval++;
} while (getNumberOfChunks(configDB) <= numChunks);
 
db.printShardingStatus(true);
st.stop();

Sprint: Sharding 1 04/03/15, Sharding 2 04/24/15, Sharding 3 05/15/15, Sharding 4 06/05/15, Sharding 5 06/26/16
Participants:

 Description   

Original title: Auto split moves chunk to shard node running WiredTiger, despite exceeding maxSize

Original description:

The auto split of a chunk should not move the new chunk to a shard node if the maxSize is exceeded on that shard node. This behavior works fine for mmapv1, but fails using wiredTiger.



 Comments   
Comment by Andy Schwerin [ 12/Dec/16 ]

The decision making in the balancer policy is unit tested in C++ as of 3.4. If we separately want to test the accuracy of the on-disk or logical size reporting, that would be a more limited test for the storage team.

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