Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15821

Empty host split assertion message in log when maxSize prevents move chunk

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.8.0-rc0
    • Affects Version/s: 2.7.8
    • Component/s: Sharding
    • Labels:
    • ALL
    • Hide
      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 assertion does not occur on bulk write to low top chunk
      var largeStr = new Array(1000).join('x');
      var bulk = coll.initializeUnorderedBulkOp();
      for (var x = -2000; x < -2750; x--) {
          bulk.insert({ x: x, val: largeStr });
      }
      bulk.execute();
      
      // Auto split assertion happens on bulk write to high top chunk
      bulk = coll.initializeUnorderedBulkOp();
      for (var x = 2000; x < 2750; x++) {
          bulk.insert({ x: x, val: largeStr });
      }
      bulk.execute();
      
      db.printShardingStatus(true);
      
      st.stop();
      
      Show
      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 assertion does not occur on bulk write to low top chunk var largeStr = new Array(1000).join( 'x' ); var bulk = coll.initializeUnorderedBulkOp(); for ( var x = -2000; x < -2750; x--) { bulk.insert({ x: x, val: largeStr }); } bulk.execute(); // Auto split assertion happens on bulk write to high top chunk bulk = coll.initializeUnorderedBulkOp(); for ( var x = 2000; x < 2750; x++) { bulk.insert({ x: x, val: largeStr }); } bulk.execute(); db.printShardingStatus( true ); st.stop();

      The mongos has the following assertion message in the log, when an auto split occurs on a high top chunk and maxSize prevents the move chunk:

       m30999| 2014-10-27T16:43:22.123-0400 I SHARDING [conn1] autosplitted test.topchunk shard: ns: test.topchunk, sh
      ard: shard0000:localhost:30000, lastmod: 1|38||000000000000000000000000, min: { x: 1475.0 }, max: { x: MaxKey }
      into 3 (splitThreshold 943718) (migrate suggested)
       m30999| 2014-10-27T16:43:22.124-0400 D SHARDING [conn1] found 2 shards listed on config server(s): localhost:30
      000 (127.0.0.1)
       m30999| 2014-10-27T16:43:22.125-0400 D SHARDING [conn1] shard0000 has already reached the maximum total chunk s
      ize.
       m30999| 2014-10-27T16:43:22.125-0400 D SHARDING [conn1] shard0001 has already reached the maximum total chunk s
      ize.
       m30999| 2014-10-27T16:43:22.125-0400 I SHARDING [conn1] moving chunk (auto): ns: test.topchunk, shard: shard000
      0:localhost:30000, lastmod: 2|4||000000000000000000000000, min: { x: 2749.0 }, max: { x: MaxKey } to:
       m30999| 2014-10-27T16:43:22.125-0400 D -        [conn1] User Assertion: 9:Empty host component parsing HostAndPort from ""
       m30999| 2014-10-27T16:43:22.125-0400 W SHARDING [conn1] could not autosplit collection test.topchunk :: caused by :: 9 Empty host component parsing HostAndPort from ""
      

            Assignee:
            randolph@mongodb.com Randolph Tan
            Reporter:
            jonathan.abrahams Jonathan Abrahams
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: