raftstore: use batch split for auto-split
@@ -453,6 +453,7 @@ where
}
}
+ // Deprecate
fn handle_ask_split(
&self,
handle: &Handle,
@@ -505,6 +506,7 @@ where
peer: metapb::Peer,
right_derive: bool,
callback: Callback<E>,
+ task: String,
) {
let router = self.router.clone();
let scheduler = self.scheduler.clone();
@@ -519,6 +521,7 @@ where
"region_id" => region.get_id(),
"new_region_ids" => ?resp.get_ids(),
"region" => ?region,
+ "task" => task,
);
let req = new_batch_split_region_request(
@@ -913,6 +916,7 @@ where
}
match task {
+ // AskSplit has deprecated, use AskBatchSplit
Task::AskSplit {
region,
split_key,
@@ -926,7 +930,7 @@ where
peer,
right_derive,
callback,
- String::from("AskSplit"),
+ String::from("ask_split"),
),
Task::AskBatchSplit {
region,
@@ -941,20 +945,21 @@ where
peer,
right_derive,
callback,
+ String::from("batch_split"),
),
Task::AutoSplit { split_infos } => {
for split_info in split_infos {
if let Ok(Some(region)) =
self.pd_client.get_region_by_id(split_info.region_id).wait()
{
- self.handle_ask_split(
+ self.handle_ask_batch_split(
handle,
region,
- split_info.split_key,
+ vec![split_info.split_key],
split_info.peer,
true,
Callback::None,
- String::from("AutoSplit"),
+ String::from("auto_split"),
);
}
}
