Skip to content

Commit f711cfa

Browse files
authored
Merge pull request #1754 from tursodatabase/libsql-wal-fixes
libsql wal fixes
2 parents 5cfdd70 + 39a6973 commit f711cfa

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

libsql-server/src/connection/legacy.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ where
380380
ctx: RequestContext,
381381
builder: B,
382382
) -> Result<B> {
383-
let config = self.inner.lock().config();
383+
let inner = self.inner.clone();
384+
let config = tokio::task::spawn_blocking(move || inner.lock().config())
385+
.await
386+
.unwrap();
384387
check_program_auth(&ctx, &pgm, &config).await?;
385388
let conn = self.inner.clone();
386389
CoreConnection::run_async(conn, pgm, builder).await

libsql-server/src/connection/libsql.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ impl LibsqlConnection {
9393
ctx: RequestContext,
9494
builder: B,
9595
) -> Result<B> {
96-
let config = self.inner.lock().config();
96+
let inner = self.inner.clone();
97+
let config = tokio::task::spawn_blocking(move || inner.lock().config())
98+
.await
99+
.unwrap();
97100
check_program_auth(&ctx, &pgm, &config).await?;
98101
let conn = self.inner.clone();
99102
CoreConnection::run_async(conn, pgm, builder).await

libsql-server/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ type MakeReplicationSvc = Box<
147147
// static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
148148

149149
#[global_allocator]
150-
static GLOBAL: rheaper::Allocator<mimalloc::MiMalloc> =
151-
rheaper::Allocator::from_allocator(mimalloc::MiMalloc);
150+
static GLOBAL: rheaper::Allocator<std::alloc::System> =
151+
rheaper::Allocator::from_allocator(std::alloc::System);
152152

153153
#[derive(clap::ValueEnum, PartialEq, Clone, Copy, Debug)]
154154
pub enum CustomWAL {

libsql-wal/src/segment/current.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,7 @@ impl SegmentIndex {
654654
offsets
655655
.iter()
656656
.rev()
657-
.find(|fno| **fno as u64 <= max_offset)
657+
.find(|fno| (**fno as u64) < max_offset)
658658
.copied()
659659
}
660660

0 commit comments

Comments
 (0)