diff --git a/crates/ecstore/src/api/mod.rs b/crates/ecstore/src/api/mod.rs index 50f2202a7..4b3162313 100644 --- a/crates/ecstore/src/api/mod.rs +++ b/crates/ecstore/src/api/mod.rs @@ -346,7 +346,7 @@ pub mod disk { } pub mod error { - pub use crate::disk::error::{BitrotErrorType, DiskError, Error, FileAccessDeniedWithContext, Result}; + pub use crate::disk::error::{DiskError, Error, FileAccessDeniedWithContext, Result}; } pub mod error_reduce { diff --git a/crates/ecstore/src/disk/error.rs b/crates/ecstore/src/disk/error.rs index c01161846..51fb04daa 100644 --- a/crates/ecstore/src/disk/error.rs +++ b/crates/ecstore/src/disk/error.rs @@ -113,6 +113,9 @@ pub enum DiskError { #[error("bit-rot hash algorithm is invalid")] BitrotHashAlgoInvalid, + /// Never constructed locally by RustFS (only reachable through wire + /// decoding, and no current node sends it). The wire code is kept for + /// cross-version compatibility — do not renumber or remove (backlog#1831). #[error("Rename across devices not allowed, please fix your backend configuration")] CrossDeviceLink, @@ -143,6 +146,9 @@ pub enum DiskError { #[error("io error {0}")] Io(#[source] io::Error), + /// Never constructed locally by RustFS (only reachable through wire + /// decoding, and no current node sends it). The wire code is kept for + /// cross-version compatibility — do not renumber or remove (backlog#1831). #[error("source stalled")] SourceStalled, @@ -642,19 +648,6 @@ impl Hash for DiskError { // is currently commented out to avoid complexity. These can be re-enabled // when needed for specific disk quorum checking and error aggregation logic. -/// Bitrot errors -#[derive(Debug, thiserror::Error)] -pub enum BitrotErrorType { - #[error("bitrot checksum verification failed")] - BitrotChecksumMismatch { expected: String, got: String }, -} - -impl From for DiskError { - fn from(e: BitrotErrorType) -> Self { - DiskError::other(e) - } -} - /// Context wrapper for file access errors #[derive(Debug, thiserror::Error)] pub struct FileAccessDeniedWithContext { @@ -869,19 +862,6 @@ mod tests { let _disk_error: DiskError = json_error.into(); } - #[test] - fn test_bitrot_error_type() { - let bitrot_error = BitrotErrorType::BitrotChecksumMismatch { - expected: "abc123".to_string(), - got: "def456".to_string(), - }; - - assert!(bitrot_error.to_string().contains("bitrot checksum verification failed")); - - let disk_error: DiskError = bitrot_error.into(); - assert!(matches!(disk_error, DiskError::Io(_))); - } - #[test] fn test_file_access_denied_with_context() { let path = PathBuf::from("/test/path");