Skip to content

Commit

Permalink
feat: enable wal in single mode
Browse files Browse the repository at this point in the history
Signed-off-by: tangruilin <[email protected]>
  • Loading branch information
Tangruilin committed Jun 20, 2024
1 parent 9d0cbb0 commit abc0472
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ void DB::LoadDBFromCheckpoint(const std::string& checkpoint_path, bool sync [[ma
abort();
}

// in single-mode, pikiwidb will enable wal
if (!g_config.use_raft.load(std::memory_order_relaxed)) {
storage_->DisableWal(false);
}

opened_ = true;
INFO("DB{} load a checkpoint from {} success!", db_index_, checkpoint_path);
}
Expand Down
2 changes: 0 additions & 2 deletions src/pikiwidb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ bool PikiwiDB::Init() {
PREPL.SetMasterAddr(g_config.master_ip.ToString().c_str(), g_config.master_port.load());
}

// cmd_table_manager_.InitCmdTable();

return true;
}

Expand Down

0 comments on commit abc0472

Please sign in to comment.