Comments (11)
Taking this, with the hope of having a quick document or write-up in a few hours.
from vitess.
I've started writing a document, but it's a first draft and probably will take a couple of days to finalize.
@mitiger, if you need something faster than that, I can provide you with a minimal set of commands that need to be run. You can also take a look at test/initial_sharding.py:test_resharding to see what commands are run for the end-to-end test.
from vitess.
@aaijazi , I hava read initial_sharding.py , and try in my server.
there is a question, when i exec command : "./vtworker -min_healthy_rdonly_endpoints=1 -cell=test SplitDiff test_keyspace/-80"
vttablet logs show :
can't read startPosition: error Table '_vt.blp_checkpoint' doesn't exist (errno 1146) during query: SELECT pos, flags FROM _vt.blp_checkpoint WHERE source_shard_uid=0 in selecting from recovery table SELECT pos, flags FROM _vt.blp_checkpoint WHERE source_shard_uid=0
blp_chekpoint not found , i don't know when table blp_checkpoint create ?
from vitess.
@aaijazi , please give me the minimal set of commands ,so i can see if some commands lost in my demo.
thanks a lot
from vitess.
@mitiger try adding --strategy=-populate_blp_checkpoint
to your vtworker command when doing SplitClone:
./vtworker -min_healthy_rdonly_endpoints=1 -cell=test SplitClone --strategy=-populate_blp_checkpoint test_keyspace/0
I'll get you the minimal set of commands in a few minutes.
from vitess.
@aaijazi , the command
./vtworker -min_healthy_rdonly_endpoints=1 -cell=test SplitClone --strategy=-populate_blp_checkpoint test_keyspace/0"
take a long time , and not success?
Always print log as follows:
Running:
Copying from: test-0000000003
ETA: 2015-03-03 14:56:01.238102924 +0800 CST
test_table: copy done, copied 200 rows
is it normally?
from vitess.
@mitiger: I haven't tested these exact commands myself, but I think they should you get going.
Preparing source shard
- Make sure you have a column that you can use as a sharding key on the source shard.
- Indicate to Vitess what that sharding column is, e.g.,
vtctl SetKeyspaceShardingInfo -force test_keyspace keyspace_id uint64
- Make sure you have an rdonly tablet in the source shard
Preparing destination shards
- Reparent each shard, e.g.,
vtctl ReparentShard -force test_keyspace/-64 <master tablet alias>
so that each destination shard has selected a master tablet.
Cloning the data
- Copy the schema onto each destination shard:
vtctl CopySchemaShard <source rdonly tablet alias> test_keyspace/-64
- Run a SplitClone vtworker to stream the data from the source to destinations. Example:
vtworker -min_healthy_rdonly_endpoints=1 --cell=test SplitClone --strategy=-populate_blp_checkpoint test_keyspace/0
Verify data was copied correctly (optional, but recommended)
- Run a single SplitDiff vtworker:
vtworker -min_healthy_rdonly_endpoints=1 --cell=test SplitDiff test_keyspace/-64
- If the above is successful, repeat the step for the next destination shard. Make sure that you don't run the commands in parallel, but let each shard's diff run sequentially.
Start serving traffic from destination shard
- Migrate rdonly traffic:
vtctl MigrateServedTypes test_keyspace/0 rdonly
- If successful, migrate replica traffic:
vtctl MigrateServedTypes test_keyspace/0 replica
- If successful, migrate master traffic:
vtctl MigrateServedTypes test_keyspace/0 master
Scrap the source shard
Note: only do these steps if all the above steps were successful.
- For each tablet in the source shard:
vtctl ScrapTablet <source tablet alias>
- For each tablet in the source shard:
vtctl DeleteTablet <source tablet alias>
- Rebuild serving graph:
vtctl RebuildKeyspaceGraph test_keyspace
vtctl DeleteShard test_keyspace/0
from vitess.
@mitiger That looks like fairly normal output for the copy command. What makes you say it won't succeed? How many tables/rows were you expecting? How long did it run for?
You can monitor the status of the copy by viewing the status page in your browser. It should also log/print the status every second.
from vitess.
@aaijazi , in my keyspace , just one table and 200 rows .
this log print then 5 minutes, then i stop it with ctrl + C !!
from vitess.
@aaijazi i found the table _vt.blp_checkpoint not been created .
and i see the source code , create blp_checkpoint is in command CopySchemaShard ??
i think the reason is here .
from vitess.
@mitiger: if the source shard has the _vt.blp_checkpoint
table, then it will be created with the CopySchemaShard command. If the source shard does not have that table, it should be created by the SplitClone command, but only if --strategy=-populate_blp_checkpoint
is given.
You might want to try deleting the destination tablets, and then trying the sharding steps again (in case your destination tablets are in a bad state).
If that doesn't succeed, please provide a link to the full logs from the failing operation, and I can try to help track down what's going wrong.
from vitess.
Related Issues (20)
- UNION with literals and grouping fails planning
- Online DDL: switch unique key and column logic to declarative `schemadiff` analysis
- Bug Report: `Group_concat` with separator crashes vtgate during planning
- Bug Report: `show vitess_migrations` not supported from inside a transaction HOT 2
- Feature Request: `txthrottler` to poll replication lag on `PRIMARY` only
- Investigate GOGC performance impact
- RFC: Atomic Distributed Transactions HOT 4
- Bug Report: Json_ArrayAgg and Json_ObjectAgg not working in having clause HOT 1
- DECIMAL Values returned as BIGINT
- Wrong results from query with GROUP BY and LIMIT
- RFC: Improve Topology Server Locking
- Feature Request: Better aggregation planning
- `mysqlbinlog` not found during incremental backup in v19.x and v20.x HOT 1
- Bug Report: vtctldclient Reshard panic when target shard has no PRIMARY tablet
- Feature Request: `vitess/vtctldclient` container image HOT 6
- Feature Request: MySQL Shell Logical Backups
- Reverse workflows fail in some MoveTables workflows in FKManaged clusters HOT 1
- vtorc/vttablet: can't downgrade from v20 to v19 HOT 17
- Bug Report: long GTIDs cause xtrabackup backups to fail HOT 1
- Feature Request: make VDiff support multi-tenant migrations HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vitess.