Skip to content

Commit

Permalink
remove useless delete op
Browse files Browse the repository at this point in the history
  • Loading branch information
v0y4g3r committed Oct 29, 2024
1 parent 0988ec2 commit 3a492fe
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/common/meta/src/key/datanode_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,11 @@ impl DatanodeTableManager {
// substitute region options only.
region_info.region_options = new_region_options;

let mut txns = Vec::with_capacity(region_distribution.len() * 2);
let mut txns = Vec::with_capacity(region_distribution.len());

for (datanode, regions) in region_distribution.into_iter() {
let key = DatanodeTableKey::new(datanode, table_id);
let key_bytes = key.to_bytes();
txns.push(TxnOp::Delete(key_bytes.clone()));

let value_bytes = DatanodeTableValue::new(table_id, regions, region_info.clone())
.try_as_raw_value()?;
txns.push(TxnOp::Put(key_bytes, value_bytes));
Expand Down

0 comments on commit 3a492fe

Please sign in to comment.