mirror of
https://github.com/talent-plan/tinykv.git
synced 2025-01-29 22:00:39 +08:00
Update project3-MultiRaftKV.md (#250)
This commit is contained in:
parent
3dcc4f1ede
commit
aa616ee404
@ -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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user