Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bottomless: emit restored snapshot for waiters #1252

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bottomless/src/replicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ impl Replicator {
Err(_) => true,
})
.await?;
tracing::debug!("done waiting");
match res.deref() {
Ok(_) => Ok(true),
Err(e) => Err(anyhow!("Failed snapshot generation {}: {}", generation, e)),
Expand Down Expand Up @@ -923,6 +924,7 @@ impl Replicator {
let _ = self.snapshot_notifier.send(Ok(self.generation().ok()));
return Ok(None);
}
tracing::debug!("snapshotting db file");
if !self.main_db_exists_and_not_empty().await {
let generation = self.generation()?;
tracing::debug!(
Expand Down Expand Up @@ -1561,6 +1563,9 @@ impl Replicator {
};

let (action, recovered) = self.restore_from(generation, timestamp).await?;

let _ = self.snapshot_notifier.send(Ok(Some(generation)));

tracing::info!(
"Restoring from generation {generation}: action={action:?}, recovered={recovered}"
);
Expand Down
18 changes: 18 additions & 0 deletions libsql-server/local-test-envs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

export LIBSQL_BOTTOMLESS_AWS_ACCESS_KEY_ID=minioadmin
export LIBSQL_BOTTOMLESS_AWS_DEFAULT_REGION=us-east-1
export LIBSQL_BOTTOMLESS_AWS_SECRET_ACCESS_KEY=minioadmin
export LIBSQL_BOTTOMLESS_BUCKET=turso-dev
export LIBSQL_BOTTOMLESS_DATABASE_ID=5d64e223-21a3-4835-9815-9613216d9859
export LIBSQL_BOTTOMLESS_ENDPOINT=http://localhost:9000
export LIBSQL_BOTTOMLESS_VERIFY_CRC=false
export SQLD_BACKUP_META_STORE=true
export SQLD_ENABLE_BOTTOMLESS_REPLICATION=true
export SQLD_META_STORE_ACCESS_KEY_ID=minioadmin
export SQLD_META_STORE_BACKUP_ID=metastore-dev
export SQLD_META_STORE_BACKUP_INTERVAL_S=1
export SQLD_META_STORE_BUCKET_ENDPOINT=http://localhost:9000
export SQLD_META_STORE_BUCKET_NAME=turso-dev
export SQLD_META_STORE_REGION=us-east-1
export SQLD_META_STORE_SECRET_ACCESS=minioadmin
Loading