Skip to content

Commit

Permalink
refactor: add RemoteCompaction error
Browse files Browse the repository at this point in the history
  • Loading branch information
zyy17 committed Jul 2, 2024
1 parent 7ea52ff commit 4c52e29
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mito2/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -768,6 +769,20 @@ pub enum Error {
#[snafu(implicit)]
location: Location,
},

#[snafu(display(
"Failed to remote 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>;
Expand Down Expand Up @@ -888,6 +903,7 @@ impl ErrorExt for Error {
TimeRangePredicateOverflow { .. } => StatusCode::InvalidArguments,
BuildTimeRangeFilter { .. } => StatusCode::Unexpected,
UnsupportedOperation { .. } => StatusCode::Unsupported,
RemoteCompaction { .. } => StatusCode::Unexpected,
}
}

Expand Down

0 comments on commit 4c52e29

Please sign in to comment.