zstore: indexedlog open => open_with_repair

Summary: See previous diffs for context.

Reviewed By: DurhamG

Differential Revision: D33109473

fbshipit-source-id: d928bcd6edb0bf5087f98329f8aa3a9e923b9e9f
This commit is contained in:
Jun Wu 2021-12-15 19:03:13 -08:00 committed by Facebook GitHub Bot
parent ab83a58cf9
commit ba0ec6c7ae

View File

@ -16,6 +16,7 @@ use std::path::PathBuf;
use indexedlog::log as ilog;
use indexedlog::DefaultOpenOptions;
use indexedlog::OpenWithRepair;
use lazy_static::lazy_static;
use lru_cache::LruCache;
use minibytes::Bytes;
@ -95,7 +96,7 @@ impl OpenOptions {
/// Load or create [`Zstore`] at the given directory.
pub fn open(&self, dir: &Path) -> crate::Result<Zstore> {
let log = Zstore::default_open_options().open(dir)?;
let log = Zstore::default_open_options().open_with_repair(dir)?;
// The cache_size should be greater than len(metalog.keys()))
Ok(Zstore {
dir: dir.to_path_buf(),