From fb082ac1429aa60658901410e1a6a535bc0a4030 Mon Sep 17 00:00:00 2001 From: ad hoc Date: Wed, 4 Sep 2024 11:07:15 +0200 Subject: [PATCH] Apply suggestions from code review --- libsql-server/src/main.rs | 2 +- libsql-wal/src/checkpointer.rs | 2 +- libsql-wal/src/registry.rs | 1 - libsql-wal/src/segment/sealed.rs | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/libsql-server/src/main.rs b/libsql-server/src/main.rs index 5fd69cd133..7295bf9d16 100644 --- a/libsql-server/src/main.rs +++ b/libsql-server/src/main.rs @@ -298,7 +298,7 @@ struct Cli { long, env = "LIBSQL_SYNC_CONCCURENCY", requires = "sync_from_storage", - default_value = "8", + default_value = "8" )] sync_conccurency: usize, } diff --git a/libsql-wal/src/checkpointer.rs b/libsql-wal/src/checkpointer.rs index 176140c2cc..98682481eb 100644 --- a/libsql-wal/src/checkpointer.rs +++ b/libsql-wal/src/checkpointer.rs @@ -158,7 +158,7 @@ where self.errors = 0; } } - Some(Err(e)) => panic!("checkoint task panicked: {e}"), + Some(Err(e)) => panic!("checkpoint task panicked: {e}"), None => unreachable!("got None, but join set is not empty") } } diff --git a/libsql-wal/src/registry.rs b/libsql-wal/src/registry.rs index e922903b3f..628def2cdf 100644 --- a/libsql-wal/src/registry.rs +++ b/libsql-wal/src/registry.rs @@ -543,7 +543,6 @@ where Some(Ok(mut frame)) => { if stream.peek().await.is_none() { drop(stream); - frame.header_mut().frame_no(); frame.header_mut().set_size_after(seen.len() as _); injector.insert_frame(frame).await?; break; diff --git a/libsql-wal/src/segment/sealed.rs b/libsql-wal/src/segment/sealed.rs index cc6b9d9342..f5f3b244a8 100644 --- a/libsql-wal/src/segment/sealed.rs +++ b/libsql-wal/src/segment/sealed.rs @@ -110,8 +110,8 @@ where while let Some((page_no_bytes, offset)) = pages.next() { let (mut b, ret) = self.read_frame_offset_async(offset as _, buffer).await; ret?; - // transaction boundaries in a segment are completely erased. The responsibility in on - // the user of the segment to place the transaction boundary such that all frames from + // transaction boundaries in a segment are completely erased. The responsibility is on + // the consumer of the segment to place the transaction boundary such that all frames from // the segment are applied within the same transaction. b.get_mut().header_mut().set_size_after(0); hasher.update(&b.get_ref().as_bytes());