From e9b2aea7515c068748646dc7ac2cedf9b397ce66 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Thu, 11 Jan 2024 18:40:51 +0000 Subject: [PATCH] fix: incorrect updating DatanodeTable value --- src/common/meta/src/key/datanode_table.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/meta/src/key/datanode_table.rs b/src/common/meta/src/key/datanode_table.rs index 13a88e9ee9ef..9b5ec097b59b 100644 --- a/src/common/meta/src/key/datanode_table.rs +++ b/src/common/meta/src/key/datanode_table.rs @@ -236,7 +236,15 @@ impl DatanodeTableManager { if need_update { let key = DatanodeTableKey::new(datanode, table_id); let raw_key = key.as_raw_key(); - let val = DatanodeTableValue::new(table_id, regions, region_info.clone()) + // FIXME(weny): add unit tests. + let mut new_region_info = region_info.clone(); + if need_update_options { + new_region_info.region_options = new_region_options.clone(); + } + if need_update_wal_options { + new_region_info.region_wal_options = new_region_wal_options.clone(); + } + let val = DatanodeTableValue::new(table_id, regions, new_region_info) .try_as_raw_value()?; opts.push(TxnOp::Put(raw_key, val)); }