Skip to content

Commit

Permalink
chore: remove the redandent table ids alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjiachun committed Mar 27, 2024
1 parent 50c37e4 commit a130f9b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
9 changes: 0 additions & 9 deletions src/common/meta/src/ddl/table_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,6 @@ impl TableMetadataAllocator {
region_wal_options,
})
}

/// Sets table ids with all tasks.
pub async fn set_table_ids_on_logic_create(&self, tasks: &mut [CreateTableTask]) -> Result<()> {
for task in tasks {
let table_id = self.allocate_table_id(task).await?;
task.table_info.ident.table_id = table_id;
}
Ok(())
}
}

pub type PeerAllocatorRef = Arc<dyn PeerAllocator>;
Expand Down
7 changes: 1 addition & 6 deletions src/common/meta/src/ddl_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ async fn handle_create_table_task(
async fn handle_create_logical_table_tasks(
ddl_manager: &DdlManager,
cluster_id: ClusterId,
mut create_table_tasks: Vec<CreateTableTask>,
create_table_tasks: Vec<CreateTableTask>,
) -> Result<SubmitDdlTaskResponse> {
ensure!(
!create_table_tasks.is_empty(),
Expand All @@ -554,11 +554,6 @@ async fn handle_create_logical_table_tasks(
&create_table_tasks,
)
.await?;
// Sets table_ids on create_table_tasks
ddl_manager
.table_metadata_allocator
.set_table_ids_on_logic_create(&mut create_table_tasks)
.await?;
let num_logical_tables = create_table_tasks.len();

let (id, output) = ddl_manager
Expand Down

0 comments on commit a130f9b

Please sign in to comment.