c# - Azure Elastic Scale: Split-Merge Tutorial - Can't Split a Shard -


i followed tutorial here created things mentioned , deployed service. can run well.

my elastic db contains 1 range shard minvalue set 0, , maxvalue set infinity (null).

then split shard two. did following:

  1. created new db same schema shard 1
  2. ran service , said target db has part of shard mappings. failed !!!
  3. now add new db shard in shard map manager database, downloaded .net api available @ nuget package, modified settings etc, wont add new shard first shard range (0 - infinity) wont allow it. failed again :(
  4. now got hands dirty , modified actual [__shardmanagement].[shardmappingsglobal] table contain these range mappings in shard map manager database. went there , set maxvalue column shard to, say, 20. while shard contains, say, sharding key upto 30.
  5. now again ran downloaded .net api, specifying new shard start value 20 - infinity. worked , new shard registered in smm db.

(i thought service split shard 1, data sharding key 21, , insert shard 2 minvalue 21.)

  1. ran service again, , threw following error:

    the source , target mappings both point same shard 'new_shard'.

hmmm... may because maxvalue of first shard , minvalue of new shard same.

  1. now went , updated maxvalue = null (infinity) first shard want split. ran service again, , recieved following error:

    the source , target mappings both point same shard 'new_shard'.

what hell going on? why hard? proper documentation this?

this important me, , appreciate in splitting damn shard.

thanks.

thanks question on split/merge. let's see whether helps:

based on steps documented above, seems ended doing 2 things in step 3):

  • you added new database empty shard shard map, and
  • you tried assign mapping points newly added shard.

the first part (adding empty shard) should have succeeded, while second part (adding mapping) have failed in case because of existing mapping first shard covers complete domain.

if sounds right far, can try following steps:

  1. reset shard map original state (0 - infinity) range points again first shard. might best recreate shard map scratch.
  2. rerun step 1) above have clean database schema.
  3. add clean database previous step shard existing shard map call this: shardmap.createshard(new shardlocation(shardserver, "your_clean_database"));. make sure not call shardmap.createrangemapping(.). not needed , fail again because (0 - infinity) range assigned first shard. split operation change mappings part of operation.
  4. submit split operation.

in case, please not modify [__shardmanagement] tables directly. maintained through apis of library pulled nuget or split/merge tool.

here few pointers additional documentation:

hope helps. if still running issues, please reach out me offline @ torsteng(at)microsoft(dot)com.

thanks, torsten


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -