mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-07 20:46:11 +00:00
chore(deps): refresh mimalloc and codec usage (#7096)
This commit is contained in:
@@ -163,7 +163,7 @@ http-body = { workspace = true }
|
||||
http-body-util.workspace = true
|
||||
url.workspace = true
|
||||
uuid = { workspace = true, features = ["v4", "fast-rng", "serde", "macro-diagnostics"] }
|
||||
reed-solomon-erasure = { workspace = true, features = ["simd-accel"] }
|
||||
rustfs-erasure-codec = { workspace = true, features = ["simd-accel"] }
|
||||
reed-solomon-simd = { workspace = true }
|
||||
lazy_static.workspace = true
|
||||
moka = { workspace = true, features = ["future", "sync"] }
|
||||
|
||||
@@ -122,10 +122,10 @@ fn bench_encode_performance(c: &mut Criterion) {
|
||||
});
|
||||
group.finish();
|
||||
|
||||
// Test direct reed-solomon-erasure implementation for large shards (>= 512 bytes)
|
||||
// Test direct rustfs-erasure-codec implementation for large shards (>= 512 bytes)
|
||||
let shard_size = calc_shard_size(config.data_size, config.data_shards);
|
||||
if shard_size >= 512 && config.parity_shards > 0 {
|
||||
use reed_solomon_erasure::galois_8::ReedSolomon;
|
||||
use rustfs_erasure_codec::galois_8::ReedSolomon;
|
||||
|
||||
let mut rse_group = c.benchmark_group("encode_rse_direct");
|
||||
rse_group.throughput(Throughput::Bytes(config.data_size as u64));
|
||||
@@ -204,10 +204,10 @@ fn bench_decode_performance(c: &mut Criterion) {
|
||||
);
|
||||
group.finish();
|
||||
|
||||
// Test direct reed-solomon-erasure decoding for large shards
|
||||
// Test direct rustfs-erasure-codec decoding for large shards
|
||||
let shard_size = calc_shard_size(config.data_size, config.data_shards);
|
||||
if shard_size >= 512 && config.parity_shards > 0 {
|
||||
use reed_solomon_erasure::galois_8::ReedSolomon;
|
||||
use rustfs_erasure_codec::galois_8::ReedSolomon;
|
||||
|
||||
if let Ok(rs) = ReedSolomon::new(config.data_shards, config.parity_shards) {
|
||||
let mut rse_group = c.benchmark_group("decode_rse_direct");
|
||||
|
||||
@@ -845,7 +845,7 @@ mod tests {
|
||||
use std::error::Error as _;
|
||||
|
||||
let error = DiskError::from(ErasureConstructionError::ModernEncoder {
|
||||
source: reed_solomon_erasure::Error::TooManyShards,
|
||||
source: rustfs_erasure_codec::Error::TooManyShards,
|
||||
});
|
||||
let io_source = error.source().expect("DiskError::Io must expose its io::Error source");
|
||||
assert!(io_source.is::<io::Error>());
|
||||
@@ -856,7 +856,7 @@ mod tests {
|
||||
let encoder_source = construction_source
|
||||
.source()
|
||||
.expect("construction error must expose the encoder error");
|
||||
assert!(encoder_source.is::<reed_solomon_erasure::Error>());
|
||||
assert!(encoder_source.is::<rustfs_erasure_codec::Error>());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
use crate::erasure::codec::workspace::RustfsCodecDecodeWorkspace;
|
||||
use crate::erasure::coding::Erasure;
|
||||
use reed_solomon_erasure::galois_8::ReedSolomon;
|
||||
use rustfs_erasure_codec::galois_8::ReedSolomon;
|
||||
use std::io;
|
||||
use std::sync::{Arc, OnceLock};
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! Erasure coding implementation using reed-solomon-erasure (GF(2^8)).
|
||||
//! Erasure coding implementation using rustfs-erasure-codec (GF(2^8)).
|
||||
//! Supports legacy (reed-solomon-simd) for reading/healing old-version files.
|
||||
//!
|
||||
|
||||
use bytes::{Bytes, BytesMut};
|
||||
use reed_solomon_erasure::galois_8::ReedSolomon;
|
||||
use reed_solomon_simd;
|
||||
use rustfs_erasure_codec::galois_8::ReedSolomon;
|
||||
use smallvec::SmallVec;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
@@ -69,7 +69,7 @@ impl EncodedBlock {
|
||||
}
|
||||
}
|
||||
|
||||
const MODERN_MAX_TOTAL_SHARDS: usize = <reed_solomon_erasure::galois_8::Field as reed_solomon_erasure::Field>::ORDER;
|
||||
const MODERN_MAX_TOTAL_SHARDS: usize = <rustfs_erasure_codec::galois_8::Field as rustfs_erasure_codec::Field>::ORDER;
|
||||
const MODERN_REED_SOLOMON_CACHE_MAX_ENTRIES: usize = 64;
|
||||
const LEGACY_REED_SOLOMON_CACHE_MAX_ENTRIES: usize = 16;
|
||||
// Vec growth may retain twice the requested logical length. Keeping the logical
|
||||
@@ -109,7 +109,7 @@ pub enum ErasureConstructionError {
|
||||
#[error("failed to construct modern Reed-Solomon encoder")]
|
||||
ModernEncoder {
|
||||
#[source]
|
||||
source: reed_solomon_erasure::Error,
|
||||
source: rustfs_erasure_codec::Error,
|
||||
},
|
||||
|
||||
/// The legacy encoder wrapper failed to initialize.
|
||||
@@ -354,7 +354,7 @@ impl LegacyReedSolomonEncoder {
|
||||
}
|
||||
}
|
||||
|
||||
/// Reed-Solomon encoder using reed-solomon-erasure
|
||||
/// Reed-Solomon encoder using rustfs-erasure-codec
|
||||
pub struct ReedSolomonEncoder {
|
||||
data_shards: usize,
|
||||
parity_shards: usize,
|
||||
@@ -372,7 +372,7 @@ impl Clone for ReedSolomonEncoder {
|
||||
}
|
||||
|
||||
impl ReedSolomonEncoder {
|
||||
fn try_new_typed(data_shards: usize, parity_shards: usize) -> Result<Self, reed_solomon_erasure::Error> {
|
||||
fn try_new_typed(data_shards: usize, parity_shards: usize) -> Result<Self, rustfs_erasure_codec::Error> {
|
||||
let encoder = if parity_shards > 0 {
|
||||
Some(cached_modern_reed_solomon(data_shards, parity_shards)?)
|
||||
} else {
|
||||
@@ -445,7 +445,7 @@ impl ReedSolomonEncoder {
|
||||
}
|
||||
}
|
||||
|
||||
fn cached_modern_reed_solomon(data_shards: usize, parity_shards: usize) -> Result<Arc<ReedSolomon>, reed_solomon_erasure::Error> {
|
||||
fn cached_modern_reed_solomon(data_shards: usize, parity_shards: usize) -> Result<Arc<ReedSolomon>, rustfs_erasure_codec::Error> {
|
||||
let key = (data_shards, parity_shards);
|
||||
let cache = MODERN_REED_SOLOMON_CACHE.get_or_init(|| RwLock::new(HashMap::new()));
|
||||
|
||||
@@ -1407,11 +1407,11 @@ mod tests {
|
||||
#[test]
|
||||
fn construction_errors_preserve_encoder_sources() {
|
||||
let modern = ErasureConstructionError::ModernEncoder {
|
||||
source: reed_solomon_erasure::Error::TooManyShards,
|
||||
source: rustfs_erasure_codec::Error::TooManyShards,
|
||||
};
|
||||
assert!(
|
||||
std::error::Error::source(&modern)
|
||||
.and_then(|source| source.downcast_ref::<reed_solomon_erasure::Error>())
|
||||
.and_then(|source| source.downcast_ref::<rustfs_erasure_codec::Error>())
|
||||
.is_some()
|
||||
);
|
||||
|
||||
|
||||
@@ -1221,7 +1221,7 @@ mod tests {
|
||||
use std::error::Error as _;
|
||||
|
||||
let error = StorageError::from(ErasureConstructionError::ModernEncoder {
|
||||
source: reed_solomon_erasure::Error::TooManyShards,
|
||||
source: rustfs_erasure_codec::Error::TooManyShards,
|
||||
});
|
||||
let io_source = error.source().expect("StorageError::Io must expose its io::Error source");
|
||||
assert!(io_source.is::<std::io::Error>());
|
||||
@@ -1232,7 +1232,7 @@ mod tests {
|
||||
let encoder_source = construction_source
|
||||
.source()
|
||||
.expect("construction error must expose the encoder error");
|
||||
assert!(encoder_source.is::<reed_solomon_erasure::Error>());
|
||||
assert!(encoder_source.is::<rustfs_erasure_codec::Error>());
|
||||
}
|
||||
|
||||
// The lifecycle transition worker relies on this arm alone to suppress the
|
||||
|
||||
Reference in New Issue
Block a user