feat: create tables in batch on prom write (#3246)

* feat: create tables in batch on prom write

* feat: add logic table ids to log

* fix: miss tabble ids in response
This commit is contained in:
JeremyHi
2024-01-26 20:47:24 +08:00
committed by GitHub
parent 7da8f22cda
commit 3201aea360
3 changed files with 89 additions and 16 deletions

View File

@@ -162,9 +162,11 @@ impl CreateLogicalTablesProcedure {
manager.create_logic_tables_metadata(tables_data).await?;
}
info!("Created {num_tables} tables metadata for physical table {physical_table_id}");
let table_ids = self.creator.data.real_table_ids();
Ok(Status::done_with_output(self.creator.data.real_table_ids()))
info!("Created {num_tables} tables {table_ids:?} metadata for physical table {physical_table_id}");
Ok(Status::done_with_output(table_ids))
}
fn create_region_request_builder(

View File

@@ -203,7 +203,7 @@ impl TryFrom<PbSubmitDdlTaskResponse> for SubmitDdlTaskResponse {
fn try_from(resp: PbSubmitDdlTaskResponse) -> Result<Self> {
let table_id = resp.table_id.map(|t| t.id);
let table_ids = resp.table_ids.iter().map(|t| t.id).collect();
let table_ids = resp.table_ids.into_iter().map(|t| t.id).collect();
Ok(Self {
key: resp.key,
table_id,
@@ -219,6 +219,11 @@ impl From<SubmitDdlTaskResponse> for PbSubmitDdlTaskResponse {
table_id: val
.table_id
.map(|table_id| api::v1::meta::TableId { id: table_id }),
table_ids: val
.table_ids
.into_iter()
.map(|id| api::v1::meta::TableId { id })
.collect(),
..Default::default()
}
}