fix: checkpoint fails when deleting old logs fails (#1300)

This commit is contained in:
dennis zhuang
2023-04-02 11:06:36 +08:00
committed by GitHub
parent 0253136333
commit aea932b891

View File

@@ -19,7 +19,7 @@ use std::sync::Arc;
use std::time::Duration;
use async_trait::async_trait;
use common_telemetry::info;
use common_telemetry::{error, info};
use object_store::ObjectStore;
use store_api::manifest::action::ProtocolAction;
use store_api::manifest::{
@@ -116,10 +116,17 @@ impl Checkpointer for RegionManifestCheckpointer {
};
manifest.save_checkpoint(&checkpoint).await?;
manifest
if let Err(e) = manifest
.manifest_store()
.delete(start_version, last_version + 1)
.await?;
.await
{
// It doesn't matter when deletion fails, they will be purged by gc task.
error!(e; "Failed to delete manifest logs [{},{}] in path: {}.",
start_version,
last_version,
manifest.manifest_store().path());
}
info!("Region manifest checkpoint, start_version: {}, last_version: {}, compacted actions: {}", start_version, last_version, compacted_actions);