mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-22 16:00:38 +00:00
refactor: add RemoteCompaction error (#4251)
* refactor: make location field public * refactor: add RemoteCompaction error
This commit is contained in:
@@ -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<T, E = Error> = std::result::Result<T, E>;
|
||||
@@ -888,6 +903,7 @@ impl ErrorExt for Error {
|
||||
TimeRangePredicateOverflow { .. } => StatusCode::InvalidArguments,
|
||||
BuildTimeRangeFilter { .. } => StatusCode::Unexpected,
|
||||
UnsupportedOperation { .. } => StatusCode::Unsupported,
|
||||
RemoteCompaction { .. } => StatusCode::Unexpected,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<OutputTx>,
|
||||
|
||||
Reference in New Issue
Block a user