Skip to content

Commit

Permalink
recovery panic fix (#1059)
Browse files Browse the repository at this point in the history
* add missing config default

* check dbs dir exist before restoring
  • Loading branch information
MarinPostma authored Feb 20, 2024
1 parent a8e5710 commit 169f027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions libsql-server/src/connection/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct DatabaseConfig {
pub txn_timeout: Option<Duration>,
#[serde(default)]
pub allow_attach: bool,
#[serde(default = "default_max_row_size")]
pub max_row_size: u64,
#[serde(default)]
pub is_shared_schema: bool,
Expand Down
5 changes: 3 additions & 2 deletions libsql-server/src/namespace/meta_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ impl MetaStoreInner {

let txn = self.conn.transaction()?;
// nothing in the meta store, check fs
if count == 0 {
let dbs_dir_path = base_path.join("dbs");
if count == 0 && dbs_dir_path.try_exists()? {
tracing::info!("Recovering metastore from filesystem...");
let db_dir = read_dir(base_path.join("dbs"))?;
let db_dir = read_dir(&dbs_dir_path)?;
for entry in db_dir {
let entry = entry?;
if !entry.path().is_dir() {
Expand Down

0 comments on commit 169f027

Please sign in to comment.