Skip to content

Commit

Permalink
Update project3-MultiRaftKV.md (talent-plan#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapiz authored Feb 5, 2021
1 parent 3dcc4f1 commit aa616ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/project3-MultiRaftKV.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Let’s take a relook at Region definition, it includes two fields `start_key` a
`kv/raftstore/runner/split_check.go`. The split key will be wrapped as a `MsgSplitRegion` handled by `onPrepareSplitRegion()`.

To make sure the ids of the newly created Region and Peers are unique, the ids are allocated by the scheduler. It’s also provided, so you don’t have to implement it.
`onPrepareSplitRegion()` actually schedules a task for the pd worker to ask the scheduler for the ids. And make a split admin command after receiving the response from scheduler, see `onAskBatchSplit()` in `kv/raftstore/runner/pd_task.go`.
`onPrepareSplitRegion()` actually schedules a task for the pd worker to ask the scheduler for the ids. And make a split admin command after receiving the response from scheduler, see `onAskSplit()` in `kv/raftstore/runner/scheduler_task.go`.

So your task is to implement the process of handling split admin command, just like conf change does. The provided framework supports multiple raft, see `kv/raftstore/router.go`. When a Region splits into two Regions, one of the Regions will inherit the metadata before splitting and just modify its Range and RegionEpoch while the other will create relevant meta information.

Expand Down

0 comments on commit aa616ee

Please sign in to comment.