Skip to content

Commit

Permalink
fix load last seq in obkv wal.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachelint committed Nov 29, 2022
1 parent 6688cc0 commit 5be4757
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions wal/src/table_kv_impl/table_unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,7 @@ impl TableUnit {
table_id: TableId,
buckets: &[BucketRef],
) -> Result<SequenceNumber> {
// 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);

Expand All @@ -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<T: TableKv>(
Expand Down

0 comments on commit 5be4757

Please sign in to comment.