From 65a2247709ea94d0d7a347991569947d9d7f99fd Mon Sep 17 00:00:00 2001 From: Grzegorz Koszyk <112548209+numinnex@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:15:32 +0200 Subject: [PATCH] Fix last_index_position value on segment load (#1267) --- Cargo.lock | 2 +- server/Cargo.toml | 2 +- server/src/streaming/segments/storage.rs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b6871e15..cc3669d6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3876,7 +3876,7 @@ dependencies = [ [[package]] name = "server" -version = "0.4.50" +version = "0.4.51" dependencies = [ "ahash 0.8.11", "anyhow", diff --git a/server/Cargo.toml b/server/Cargo.toml index 75421180f..51282ec9b 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "server" -version = "0.4.50" +version = "0.4.51" edition = "2021" build = "src/build.rs" diff --git a/server/src/streaming/segments/storage.rs b/server/src/streaming/segments/storage.rs index 04be8dd6e..bb14f1bd5 100644 --- a/server/src/streaming/segments/storage.rs +++ b/server/src/streaming/segments/storage.rs @@ -51,7 +51,8 @@ impl SegmentStorage for FileSegmentStorage { ); let log_file = file::open(&segment.log_path).await?; let file_size = log_file.metadata().await.unwrap().len() as u64; - segment.size_bytes = file_size as u32; + segment.size_bytes = file_size as _; + segment.last_index_position = file_size as _; if segment.config.segment.cache_indexes { segment.indexes = Some(segment.storage.segment.load_all_indexes(segment).await?);