From 63d1c4a911288ead153e2967fed4e57f22df2637 Mon Sep 17 00:00:00 2001 From: Andika Tanuwijaya Date: Fri, 23 May 2025 20:39:25 +0700 Subject: [PATCH] bootstrap log error instead of panicking --- libsql/src/sync.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libsql/src/sync.rs b/libsql/src/sync.rs index 933ed199f7..e2c89a02de 100644 --- a/libsql/src/sync.rs +++ b/libsql/src/sync.rs @@ -766,7 +766,12 @@ pub async fn bootstrap_db(sync_ctx: &mut SyncContext) -> Result<()> { sync_ctx.sync_db_if_needed(info.current_generation).await?; // when sync_ctx is initialised, we set durable_generation to 0. however, once // sync_db is called, it should be > 0. - assert!(sync_ctx.durable_generation > 0, "generation should be > 0"); + if sync_ctx.durable_generation == 0 { + tracing::error!( + "generation should be > 0, got: {}", + sync_ctx.durable_generation + ); + } sync_ctx.initial_server_sync = true; } Ok(())