From 5be4757ad16dad4c4654e68851a9550128b6a58a Mon Sep 17 00:00:00 2001 From: kamille Date: Tue, 29 Nov 2022 14:28:04 +0800 Subject: [PATCH] fix load last seq in obkv wal. --- wal/src/table_kv_impl/table_unit.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wal/src/table_kv_impl/table_unit.rs b/wal/src/table_kv_impl/table_unit.rs index bae4cdbdb6..1c1b3ccb5d 100644 --- a/wal/src/table_kv_impl/table_unit.rs +++ b/wal/src/table_kv_impl/table_unit.rs @@ -395,8 +395,7 @@ impl TableUnit { table_id: TableId, buckets: &[BucketRef], ) -> Result { - // Starts from the latest bucket, find last sequence of given region id. - let mut last_sequence = common_types::MIN_SEQUENCE_NUMBER; + // Starts from the latest bucket, find last sequence of given table. for bucket in buckets.iter().rev() { let table_name = bucket.wal_shard_table(region_id); @@ -407,11 +406,11 @@ impl TableUnit { region_id, table_id, )? { - last_sequence = seq; + return Ok(seq); } } - Ok(last_sequence) + Ok(common_types::MIN_SEQUENCE_NUMBER) } fn load_last_sequence_from_table(