feat: add delete WAL in drop_region (#1577)

* feat: add delete WAL in drop_region

* chore: fix typo err.

* feat: mark all SSTs deleted and remove the region from StorageEngine's region map.

* test: add test_drop_region for StorageEngine.

* chore: make clippy happy

* fix: fix conflict

* chore: CR.

* chore: CR

* chore: fix clippy

* fix: temp file life time
This commit is contained in:
Vanish
2023-05-18 18:02:34 +08:00
committed by GitHub
parent d76ddc575f
commit 8764ce7845
16 changed files with 257 additions and 26 deletions

View File

@@ -54,10 +54,10 @@ pub trait LogStore: Send + Sync + 'static + std::fmt::Debug {
) -> Result<SendableEntryStream<Self::Entry, Self::Error>, Self::Error>;
/// Create a new `Namespace`.
async fn create_namespace(&mut self, ns: &Self::Namespace) -> Result<(), Self::Error>;
async fn create_namespace(&self, ns: &Self::Namespace) -> Result<(), Self::Error>;
/// Delete an existing `Namespace` with given ref.
async fn delete_namespace(&mut self, ns: &Self::Namespace) -> Result<(), Self::Error>;
async fn delete_namespace(&self, ns: &Self::Namespace) -> Result<(), Self::Error>;
/// List all existing namespaces.
async fn list_namespaces(&self) -> Result<Vec<Self::Namespace>, Self::Error>;

View File

@@ -75,6 +75,8 @@ pub trait Region: Send + Sync + Clone + std::fmt::Debug + 'static {
async fn close(&self) -> Result<(), Self::Error>;
async fn drop_region(&self) -> Result<(), Self::Error>;
fn disk_usage_bytes(&self) -> u64;
fn region_stat(&self) -> RegionStat {