mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-01 12:50:40 +00:00
feat: make RepeatedTask invoke remove_outdated_meta method (#1578)
* feat: make RepeatedTask invoke remove_outdated_meta method * fix: typo * chore: improve error message
This commit is contained in:
@@ -482,6 +482,16 @@ pub enum Error {
|
||||
|
||||
#[snafu(display("Payload not exist"))]
|
||||
PayloadNotExist { location: Location },
|
||||
|
||||
#[snafu(display("Failed to start the procedure manager"))]
|
||||
StartProcedureManager {
|
||||
source: common_procedure::error::Error,
|
||||
},
|
||||
|
||||
#[snafu(display("Failed to stop the procedure manager"))]
|
||||
StopProcedureManager {
|
||||
source: common_procedure::error::Error,
|
||||
},
|
||||
}
|
||||
|
||||
pub type Result<T> = std::result::Result<T, Error>;
|
||||
@@ -581,6 +591,9 @@ impl ErrorExt for Error {
|
||||
source.status_code()
|
||||
}
|
||||
WaitProcedure { source, .. } => source.status_code(),
|
||||
StartProcedureManager { source } | StopProcedureManager { source } => {
|
||||
source.status_code()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ use crate::datanode::{
|
||||
use crate::error::{
|
||||
self, CatalogSnafu, MetaClientInitSnafu, MissingMetasrvOptsSnafu, MissingNodeIdSnafu,
|
||||
NewCatalogSnafu, OpenLogStoreSnafu, RecoverProcedureSnafu, Result, ShutdownInstanceSnafu,
|
||||
StartProcedureManagerSnafu, StopProcedureManagerSnafu,
|
||||
};
|
||||
use crate::heartbeat::handler::parse_mailbox_message::ParseMailboxMessageHandler;
|
||||
use crate::heartbeat::handler::HandlerGroupExecutor;
|
||||
@@ -258,10 +259,17 @@ impl Instance {
|
||||
.recover()
|
||||
.await
|
||||
.context(RecoverProcedureSnafu)?;
|
||||
self.procedure_manager
|
||||
.start()
|
||||
.context(StartProcedureManagerSnafu)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn shutdown(&self) -> Result<()> {
|
||||
self.procedure_manager
|
||||
.stop()
|
||||
.await
|
||||
.context(StopProcedureManagerSnafu)?;
|
||||
if let Some(heartbeat_task) = &self.heartbeat_task {
|
||||
heartbeat_task
|
||||
.close()
|
||||
@@ -568,6 +576,7 @@ pub(crate) async fn create_procedure_manager(
|
||||
let manager_config = ManagerConfig {
|
||||
max_retry_times: procedure_config.max_retry_times,
|
||||
retry_delay: procedure_config.retry_delay,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Ok(Arc::new(LocalManager::new(manager_config, state_store)))
|
||||
|
||||
Reference in New Issue
Block a user