diff --git a/src/mito2/src/error.rs b/src/mito2/src/error.rs index 57f4e957f42c..1306edf09de7 100644 --- a/src/mito2/src/error.rs +++ b/src/mito2/src/error.rs @@ -33,6 +33,7 @@ use store_api::storage::RegionId; use crate::cache::file_cache::FileType; use crate::region::RegionState; +use crate::schedule::remote_job_scheduler::JobId; use crate::sst::file::FileId; use crate::worker::WorkerId; @@ -768,6 +769,20 @@ pub enum Error { #[snafu(implicit)] location: Location, }, + + #[snafu(display( + "Failed to remotely compact region {} by job {} due to {}", + region_id, + job_id, + reason + ))] + RemoteCompaction { + region_id: RegionId, + job_id: JobId, + reason: String, + #[snafu(implicit)] + location: Location, + }, } pub type Result = std::result::Result; @@ -888,6 +903,7 @@ impl ErrorExt for Error { TimeRangePredicateOverflow { .. } => StatusCode::InvalidArguments, BuildTimeRangeFilter { .. } => StatusCode::Unexpected, UnsupportedOperation { .. } => StatusCode::Unsupported, + RemoteCompaction { .. } => StatusCode::Unexpected, } } diff --git a/src/mito2/src/schedule/remote_job_scheduler.rs b/src/mito2/src/schedule/remote_job_scheduler.rs index ff87439e6adf..8f51a774d50d 100644 --- a/src/mito2/src/schedule/remote_job_scheduler.rs +++ b/src/mito2/src/schedule/remote_job_scheduler.rs @@ -66,7 +66,7 @@ pub trait RemoteJobScheduler: Send + Sync + 'static { #[snafu(display("Internal error occurred in remote job scheduler: {}", reason))] pub struct RemoteJobSchedulerError { #[snafu(implicit)] - location: Location, + pub location: Location, pub reason: String, // Keep the waiters in the error so that we can notify them when fallback to the local compaction. pub waiters: Vec,