mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-24 13:16:28 +00:00
fix(ecstore): harden runtime read-path quorum handling (#2872)
This commit is contained in:
@@ -678,6 +678,18 @@ pub fn is_err_read_quorum(err: &Error) -> bool {
|
||||
matches!(err, &StorageError::ErasureReadQuorum)
|
||||
}
|
||||
|
||||
pub fn classify_system_path_failure_reason(err: &Error) -> &'static str {
|
||||
match err {
|
||||
StorageError::ConfigNotFound => "config_not_found",
|
||||
StorageError::ErasureReadQuorum | StorageError::InsufficientReadQuorum(_, _) => "read_quorum",
|
||||
StorageError::Io(io_err) => match io_err.kind() {
|
||||
std::io::ErrorKind::TimedOut => "timeout",
|
||||
_ => "io",
|
||||
},
|
||||
_ => "other",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_err_invalid_upload_id(err: &Error) -> bool {
|
||||
matches!(err, &StorageError::InvalidUploadID(_, _, _))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user