mirror of
https://github.com/rustfs/rustfs.git
synced 2026-11-30 20:57:35 +00:00
feat(ecstore): opt in to higher parity for degraded PUTs (#9692)
* feat(ecstore): opt in to higher parity for degraded PUTs Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com> * fix(ecstore): count recovering drives in degraded PUT parity Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com> * test(storage): exercise recovery and late quorum loss Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com> * test(e2e): bound startup during degraded parity checks Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com> * perf(ecstore): streamline degraded PUT and writer setup Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com> * perf(ecstore): avoid redundant PUT staging work Co-Authored-By: heihutu <heihutu@gmail.com> Co-Authored-By: zhi22915 <qiuzgang@gmail.com> Co-Authored-By: qunjiazhu <qunjiazhu@gmail.com> --------- Co-authored-by: heihutu <heihutu@gmail.com> Co-authored-by: zhi22915 <qiuzgang@gmail.com> Co-authored-by: qunjiazhu <qunjiazhu@gmail.com>
This commit is contained in:
@@ -13,11 +13,11 @@
|
||||
// limitations under the License.
|
||||
|
||||
use super::harness::{
|
||||
DistCluster, DistLayout, TestResult, assert_inventory, get_object_bytes, payload_for, put_object, sha256_hex, unique_bucket,
|
||||
wait_until,
|
||||
DistCluster, DistLayout, TestResult, assert_inventory, assert_object_bytes, get_object_bytes, payload_for, put_object,
|
||||
s3_probe_client, s3_probe_error_code, sha256_hex, unique_bucket, wait_until,
|
||||
};
|
||||
use crate::chaos::{VersionShardCensus, census_object_version_on_disk, start_root_heal_when_control_ready};
|
||||
use crate::common::init_logging;
|
||||
use crate::common::{init_logging, local_http_client};
|
||||
use aws_sdk_s3::Client;
|
||||
use aws_sdk_s3::primitives::ByteStream;
|
||||
use serde_json::Value;
|
||||
@@ -35,6 +35,186 @@ const EC84_ERASURE_SET_DRIVE_COUNT: usize = EC84_DATA_BLOCKS + EC84_PARITY_BLOCK
|
||||
const EC84_TARGET_DRIVE_RESTART_CASE: &str = "ec84-target-drive-restart";
|
||||
const EC84_TARGET_DRIVE_RESTART_ORACLE: &str = "ec84-target-drive-restart.json";
|
||||
|
||||
#[tokio::test]
|
||||
async fn degraded_put_parity_survives_node_loss_and_heals() -> TestResult {
|
||||
init_logging();
|
||||
let mut dist = DistCluster::start_with_env(
|
||||
DistLayout::ThreeByFourEc84,
|
||||
&[
|
||||
("RUSTFS_STORAGE_CLASS_STANDARD", "EC:4"),
|
||||
("RUSTFS_STORAGE_CLASS_OPTIMIZE", "capacity"),
|
||||
("RUSTFS_HEAL_ENABLED", "true"),
|
||||
("RUSTFS_HEAL_AUTO_HEAL_ENABLE", "true"),
|
||||
("RUSTFS_HEAL_MRF_ENABLE", "true"),
|
||||
("RUSTFS_HEAL_OBJECT_SELECT_PROB", "1"),
|
||||
("RUSTFS_SCANNER_ENABLED", "true"),
|
||||
("RUSTFS_SCANNER_CYCLE", "1"),
|
||||
("RUSTFS_SCANNER_START_DELAY_SECS", "0"),
|
||||
],
|
||||
)
|
||||
.await?;
|
||||
let bucket = unique_bucket("degraded-parity");
|
||||
dist.create_bucket(&bucket).await?;
|
||||
let writer = s3_probe_client(&dist.client(0)?);
|
||||
let control_url = format!("{}/health/ready", dist.cluster.nodes[0].url);
|
||||
let drive_paths: Vec<PathBuf> = dist
|
||||
.cluster
|
||||
.nodes
|
||||
.iter()
|
||||
.flat_map(|node| node.data_dirs.iter().map(PathBuf::from))
|
||||
.collect();
|
||||
// The harness uses a node's first drive as its process working directory.
|
||||
let missing = &drive_paths[1];
|
||||
let present: Vec<_> = drive_paths.iter().filter(|drive| *drive != missing).collect();
|
||||
let detached = missing.with_extension("detached");
|
||||
let http = local_http_client();
|
||||
let wait_for_slots = |missing_count: usize, unavailable_count: usize, phase: &'static str| {
|
||||
let http = &http;
|
||||
let control_url = &control_url;
|
||||
async move {
|
||||
wait_until(
|
||||
Duration::from_secs(60),
|
||||
|| async {
|
||||
let response = match http.get(control_url).timeout(Duration::from_secs(3)).send().await {
|
||||
Ok(response) => response,
|
||||
Err(error) if error.is_connect() || error.is_timeout() => return Ok(false),
|
||||
Err(error) => return Err(error.into()),
|
||||
};
|
||||
let ready = response.status().is_success();
|
||||
let body: Value = response.json().await?;
|
||||
let storage = &body["details"]["storage"];
|
||||
Ok((ready || unavailable_count > 0)
|
||||
&& storage["source"] == "local_runtime"
|
||||
&& storage["missingDrives"]
|
||||
.as_array()
|
||||
.is_some_and(|drives| drives.len() == missing_count)
|
||||
&& storage["unavailableDrives"]
|
||||
.as_array()
|
||||
.is_some_and(|drives| drives.len() == unavailable_count))
|
||||
},
|
||||
phase,
|
||||
)
|
||||
.await
|
||||
}
|
||||
};
|
||||
|
||||
dist.cluster.stop_node_gracefully(0).await?;
|
||||
std::fs::rename(missing, &detached)?;
|
||||
// The missing drive prevents full peer re-admission. Exercise the normal
|
||||
// bounded startup fallback without spending the production wait twice.
|
||||
dist.cluster.set_node_env(0, "RUSTFS_STARTUP_READINESS_MAX_WAIT_SECS", "30")?;
|
||||
dist.cluster.start_node(0).await?;
|
||||
wait_for_slots(1, 0, "fixed writer sees exactly one missing drive").await?;
|
||||
let payload = payload_for("degraded-parity-streamed", 2 * 1024 * 1024);
|
||||
put_object(&writer, &bucket, "fixed.bin", payload.clone()).await?;
|
||||
|
||||
dist.cluster.stop_node_gracefully(0).await?;
|
||||
dist.cluster
|
||||
.set_node_env(0, "RUSTFS_STORAGE_CLASS_OPTIMIZE", "degraded_put_parity")?;
|
||||
dist.cluster.start_node(0).await?;
|
||||
wait_for_slots(1, 0, "opt-in writer sees exactly one missing drive").await?;
|
||||
let small = payload_for("degraded-parity-inline", 4096);
|
||||
put_object(&writer, &bucket, "adaptive.bin", payload.clone()).await?;
|
||||
put_object(&writer, &bucket, "inline.bin", small.clone()).await?;
|
||||
|
||||
let mut manifests = Vec::new();
|
||||
for (key, data, parity, inline) in [
|
||||
("fixed.bin", 8, 4, false),
|
||||
("adaptive.bin", 7, 5, false),
|
||||
("inline.bin", 7, 5, true),
|
||||
] {
|
||||
assert!(
|
||||
!census_object_version_on_disk(missing, &bucket, key, None)?.has_xl_meta,
|
||||
"{key} must omit the missing slot"
|
||||
);
|
||||
let mut shards = Vec::new();
|
||||
for drive in &present {
|
||||
let shard = census_object_version_on_disk(drive, &bucket, key, None)?;
|
||||
assert!(shard.is_complete(), "{key} must have a complete shard on each available drive");
|
||||
assert_eq!((shard.data_blocks, shard.parity_blocks), (Some(data), Some(parity)), "{key}");
|
||||
assert_eq!(shard.inline_data_fingerprint.is_some(), inline, "{key}");
|
||||
assert_eq!(shard.present_part_fingerprints.contains_key(&1), !inline, "{key}");
|
||||
shards.push(shard);
|
||||
}
|
||||
manifests.push((key, shards));
|
||||
}
|
||||
|
||||
dist.cluster.stop_node(2)?;
|
||||
wait_for_slots(1, 4, "writer sees the missing drive and a four-drive peer outage").await?;
|
||||
let fixed_error = get_object_bytes(&writer, &bucket, "fixed.bin")
|
||||
.await
|
||||
.expect_err("seven shards cannot read 8+4");
|
||||
assert!(matches!(
|
||||
s3_probe_error_code(fixed_error.as_ref()),
|
||||
Some("SlowDown" | "SlowDownRead" | "ServiceUnavailable")
|
||||
));
|
||||
assert_object_bytes(&writer, &bucket, "adaptive.bin", &payload).await?;
|
||||
assert_object_bytes(&writer, &bucket, "inline.bin", &small).await?;
|
||||
let midpoint = 1024 * 1024;
|
||||
let range = writer
|
||||
.get_object()
|
||||
.bucket(&bucket)
|
||||
.key("adaptive.bin")
|
||||
.range(format!("bytes={}-{}", midpoint - 9, midpoint + 9))
|
||||
.send()
|
||||
.await?;
|
||||
assert_eq!(range.body.collect().await?.into_bytes().as_ref(), &payload[midpoint - 9..=midpoint + 9]);
|
||||
let rejected = put_object(&writer, &bucket, "rejected.bin", payload.clone())
|
||||
.await
|
||||
.expect_err("seven drives cannot satisfy the original PUT commit floor");
|
||||
assert!(matches!(s3_probe_error_code(rejected.as_ref()), Some("SlowDown" | "ServiceUnavailable")));
|
||||
|
||||
std::fs::rename(&detached, missing)?;
|
||||
dist.cluster.start_node(2).await?;
|
||||
wait_for_slots(0, 0, "all twelve drives return to the writer").await?;
|
||||
wait_until(
|
||||
Duration::from_secs(120),
|
||||
|| async {
|
||||
for (key, shards) in &manifests {
|
||||
let rebuilt = census_object_version_on_disk(missing, &bucket, key, None)?;
|
||||
if !rebuilt.is_complete() {
|
||||
return Ok(false);
|
||||
}
|
||||
let reference = &shards[0];
|
||||
assert_eq!(rebuilt.data_blocks, reference.data_blocks, "{key}");
|
||||
assert_eq!(rebuilt.parity_blocks, reference.parity_blocks, "{key}");
|
||||
assert_eq!(rebuilt.data_dir, reference.data_dir, "{key}");
|
||||
assert_eq!(rebuilt.erasure_distribution, reference.erasure_distribution, "{key}");
|
||||
assert_eq!(
|
||||
rebuilt.inline_data_fingerprint.is_some(),
|
||||
reference.inline_data_fingerprint.is_some(),
|
||||
"{key}"
|
||||
);
|
||||
assert_eq!(rebuilt.expected_part_numbers, reference.expected_part_numbers, "{key}");
|
||||
let indices = shards
|
||||
.iter()
|
||||
.chain(std::iter::once(&rebuilt))
|
||||
.map(|shard| shard.erasure_index)
|
||||
.collect::<HashSet<_>>();
|
||||
assert_eq!(indices, (1..=12).map(Some).collect(), "{key} must have all twelve distinct shard indices");
|
||||
}
|
||||
Ok(true)
|
||||
},
|
||||
"automatic heal rebuilds the missing shard at its original geometry",
|
||||
)
|
||||
.await?;
|
||||
for (key, shards) in &manifests {
|
||||
for (drive, original) in present.iter().zip(shards) {
|
||||
assert!(
|
||||
census_object_version_on_disk(drive, &bucket, key, None)?.matches_manifest(original),
|
||||
"{key} changed an original shard"
|
||||
);
|
||||
}
|
||||
}
|
||||
for drive in &drive_paths {
|
||||
assert!(!census_object_version_on_disk(drive, &bucket, "rejected.bin", None)?.has_xl_meta);
|
||||
}
|
||||
assert_object_bytes(&writer, &bucket, "fixed.bin", &payload).await?;
|
||||
assert_object_bytes(&writer, &bucket, "adaptive.bin", &payload).await?;
|
||||
assert_object_bytes(&writer, &bucket, "inline.bin", &small).await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct ExpectedShard {
|
||||
key: String,
|
||||
|
||||
@@ -1879,6 +1879,10 @@ impl RemoteDisk {
|
||||
self.health.runtime_state()
|
||||
}
|
||||
|
||||
pub(crate) fn is_faulty(&self) -> bool {
|
||||
self.health.is_faulty()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn recovery_monitor_is_active(&self) -> bool {
|
||||
self.recovery_monitor_active.load(Ordering::Acquire)
|
||||
@@ -3913,8 +3917,7 @@ impl DiskAPI for RemoteDisk {
|
||||
|
||||
#[tracing::instrument(level = "trace", skip_all)]
|
||||
async fn is_online(&self) -> bool {
|
||||
// If disk is marked as faulty, consider it offline
|
||||
!self.health.is_faulty()
|
||||
!self.is_faulty()
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "trace", skip_all)]
|
||||
|
||||
@@ -86,6 +86,7 @@ pub const RRS_ENV: &str = "RUSTFS_STORAGE_CLASS_RRS";
|
||||
pub const STANDARD_ENV: &str = "RUSTFS_STORAGE_CLASS_STANDARD";
|
||||
// Optimize storage class environment variable
|
||||
pub const OPTIMIZE_ENV: &str = "RUSTFS_STORAGE_CLASS_OPTIMIZE";
|
||||
const DEGRADED_PUT_PARITY: &str = "degraded_put_parity";
|
||||
// Inline block indicates the size of the shard that is considered for inlining
|
||||
pub const INLINE_BLOCK_ENV: &str = "RUSTFS_STORAGE_CLASS_INLINE_BLOCK";
|
||||
|
||||
@@ -273,6 +274,10 @@ impl Config {
|
||||
self.optimize.as_ref().is_some_and(|v| v.as_str() == "capacity")
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn degraded_put_parity_enabled(&self) -> bool {
|
||||
self.initialized && self.optimize.as_deref() == Some(DEGRADED_PUT_PARITY)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
@@ -548,6 +553,27 @@ mod tests {
|
||||
StorageClassEnvOverrides::default()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn degraded_put_parity_requires_explicit_environment_mode() {
|
||||
for (mode, enabled) in [
|
||||
(None, false),
|
||||
(Some("availability"), false),
|
||||
(Some("capacity"), false),
|
||||
(Some(DEGRADED_PUT_PARITY), true),
|
||||
] {
|
||||
let config = lookup_config_for_pools_with_env(
|
||||
&DEFAULT_KVS,
|
||||
&[12],
|
||||
StorageClassEnvOverrides {
|
||||
optimize: mode.map(str::to_owned),
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.expect("storage class should resolve");
|
||||
assert_eq!(config.degraded_put_parity_enabled(), enabled, "{mode:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn should_inline_uses_fixed_default_threshold_for_every_ec_layout() {
|
||||
let config = lookup_config_for_pools_with_env(&KVS::new(), &[3, 12], no_env_overrides())
|
||||
|
||||
@@ -1902,6 +1902,15 @@ impl LocalDiskWrapper {
|
||||
self.health.runtime_state()
|
||||
}
|
||||
|
||||
pub(crate) fn is_faulty(&self) -> bool {
|
||||
self.health.is_faulty()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn mark_recovery_success_for_test(&self) -> bool {
|
||||
self.health.mark_recovery_success(&self.disk.endpoint(), "test_probe")
|
||||
}
|
||||
|
||||
pub fn offline_duration_secs(&self) -> Option<u64> {
|
||||
self.health.offline_duration().map(|duration| duration.as_secs())
|
||||
}
|
||||
@@ -2976,7 +2985,7 @@ impl DiskAPI for LocalDiskWrapper {
|
||||
async fn is_online(&self) -> bool {
|
||||
// A matching format does not make a handle usable while its I/O gate is faulty.
|
||||
// Reconnect must renew it even if its old recovery monitor has stopped.
|
||||
if self.health.is_faulty() {
|
||||
if self.is_faulty() {
|
||||
return false;
|
||||
}
|
||||
let Ok(Some(disk_id)) = self.get_disk_id().await else {
|
||||
|
||||
@@ -1486,6 +1486,13 @@ impl Disk {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn is_faulty(&self) -> bool {
|
||||
match self {
|
||||
Disk::Local(local_disk) => local_disk.is_faulty(),
|
||||
Disk::Remote(remote_disk) => remote_disk.is_faulty(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Observe a local wrapper's retirement. Remote handles have their own RPC lifecycle.
|
||||
/// Cancelling the returned child token does not retire the underlying wrapper.
|
||||
pub fn local_retirement_token(&self) -> Option<CancellationToken> {
|
||||
|
||||
@@ -4353,6 +4353,28 @@ pub(super) struct WriteLayout {
|
||||
}
|
||||
|
||||
impl WriteLayout {
|
||||
fn with_degraded_put_parity(self, disks: &[Option<DiskStore>]) -> Self {
|
||||
let drive_count = self.data_drives + self.parity_drives;
|
||||
debug_assert_eq!(disks.len(), drive_count);
|
||||
let parity_budget = drive_count / 2 - self.parity_drives;
|
||||
if self.parity_drives == 0 || parity_budget == 0 {
|
||||
return self;
|
||||
}
|
||||
|
||||
let extra_parity = disks
|
||||
.iter()
|
||||
.filter(|slot| slot.as_ref().is_none_or(|disk| disk.is_faulty()))
|
||||
.take(parity_budget)
|
||||
.count();
|
||||
// More parity never increases the layout quorum, including the tie
|
||||
// at an even split. Keep the baseline PUT commit floor.
|
||||
Self {
|
||||
data_drives: self.data_drives - extra_parity,
|
||||
parity_drives: self.parity_drives + extra_parity,
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
fn from_parity(drive_count: usize, parity_drives: usize) -> Result<Self> {
|
||||
let max_parity = drive_count / 2;
|
||||
if parity_drives > max_parity {
|
||||
@@ -4361,19 +4383,15 @@ impl WriteLayout {
|
||||
)));
|
||||
}
|
||||
|
||||
let data_drives = drive_count
|
||||
.checked_sub(parity_drives)
|
||||
.filter(|&data_drives| data_drives > 0 && parity_drives <= data_drives)
|
||||
.ok_or_else(|| Error::other(format!("invalid write layout with {drive_count} drives and parity {parity_drives}")))?;
|
||||
let write_quorum = data_drives
|
||||
.checked_add(usize::from(data_drives == parity_drives))
|
||||
.filter(|&write_quorum| write_quorum <= drive_count)
|
||||
.ok_or_else(|| Error::other(format!("invalid write quorum for {drive_count} drives and parity {parity_drives}")))?;
|
||||
if drive_count == 0 {
|
||||
return Err(Error::other("invalid write layout with 0 drives and parity 0"));
|
||||
}
|
||||
|
||||
let data_drives = drive_count - parity_drives;
|
||||
Ok(Self {
|
||||
data_drives,
|
||||
parity_drives,
|
||||
write_quorum,
|
||||
write_quorum: data_drives + usize::from(data_drives == parity_drives),
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -4411,6 +4429,23 @@ mod write_layout_tests {
|
||||
use rustfs_config::server_config::KVS;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[test]
|
||||
fn degraded_put_parity_caps_odd_and_even_sets_at_the_baseline_commit_floor() {
|
||||
for (drive_count, baseline, data, parity, quorum) in
|
||||
[(11, 4, 6, 5, 7), (12, 4, 6, 6, 8), (12, 6, 6, 6, 7), (12, 0, 12, 0, 12)]
|
||||
{
|
||||
let layout = WriteLayout::from_parity(drive_count, baseline).expect("baseline layout should resolve");
|
||||
assert_eq!(
|
||||
layout.with_degraded_put_parity(&vec![None; drive_count]),
|
||||
WriteLayout {
|
||||
data_drives: data,
|
||||
parity_drives: parity,
|
||||
write_quorum: quorum,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn automatic_standard_layout_is_resolved_per_pool() {
|
||||
let config = lookup_config_for_pools_without_env(&KVS::new(), &[4, 2])
|
||||
|
||||
@@ -4722,11 +4722,7 @@ impl SetDisks {
|
||||
rustfs_utils::http::metadata_compat::remove_str(&mut user_defined, SUFFIX_RESTORE_OPERATION_ID);
|
||||
rustfs_utils::http::metadata_compat::remove_str(&mut user_defined, SUFFIX_RESTORE_WORKER_LOCK);
|
||||
}
|
||||
let WriteLayout {
|
||||
data_drives,
|
||||
parity_drives,
|
||||
write_quorum,
|
||||
} = resolve_write_layout(
|
||||
let layout = resolve_write_layout(
|
||||
&storage_class_config,
|
||||
self.pool_index,
|
||||
disks.len(),
|
||||
@@ -4734,14 +4730,22 @@ impl SetDisks {
|
||||
user_defined.get(metadata_keys::STORAGE_CLASS).map(String::as_str),
|
||||
opts.max_parity,
|
||||
)?;
|
||||
|
||||
// if filtered_online < write_quorum {
|
||||
// warn!(
|
||||
// "online disk snapshot {} below write quorum {} for {}/{}; returning erasure write quorum error",
|
||||
// filtered_online, write_quorum, bucket, object
|
||||
// );
|
||||
// return Err(to_object_err(Error::ErasureWriteQuorum, vec![bucket, object]));
|
||||
// }
|
||||
// A zero-parity pool's metadata paths always require every slot.
|
||||
let WriteLayout {
|
||||
data_drives,
|
||||
parity_drives,
|
||||
write_quorum,
|
||||
} = if storage_class_config.degraded_put_parity_enabled()
|
||||
&& self.default_parity_count > 0
|
||||
&& !is_meta_bucketname(bucket)
|
||||
&& !opts.data_movement
|
||||
&& !opts.restore_copyback
|
||||
&& expected_restore_operation_id.is_none()
|
||||
{
|
||||
layout.with_degraded_put_parity(&disks)
|
||||
} else {
|
||||
layout
|
||||
};
|
||||
|
||||
let mut fi = FileInfo::new([bucket, object].join("/").as_str(), data_drives, parity_drives);
|
||||
if let Some(block_size) = requested_ec_block_size {
|
||||
@@ -4760,7 +4764,8 @@ impl SetDisks {
|
||||
fi.version_id = Some(Uuid::new_v4());
|
||||
}
|
||||
|
||||
fi.data_dir = Some(Uuid::new_v4());
|
||||
let data_dir = Uuid::new_v4();
|
||||
fi.data_dir = Some(data_dir);
|
||||
|
||||
// Never inherit a frame-layout marker: an incoming one (replication
|
||||
// passthrough, data movement) describes some other object identity and
|
||||
@@ -4788,9 +4793,6 @@ impl SetDisks {
|
||||
|
||||
let tmp_dir = Uuid::new_v4().to_string();
|
||||
|
||||
let tmp_data_dir = format!("{}/{}", tmp_dir, fi.data_dir.ok_or(Error::FileCorrupt)?);
|
||||
let tmp_object = format!("{tmp_data_dir}/part.1");
|
||||
|
||||
let (operation_cancellation, mut commit_cancellation_handoff_tx, cancellation_wait) =
|
||||
if let Some(cancellation) = opts.put_object_cancellation.clone() {
|
||||
let (handoff_tx, handoff_rx) = tokio::sync::oneshot::channel();
|
||||
@@ -4851,6 +4853,17 @@ impl SetDisks {
|
||||
}
|
||||
let write_path = classify_put_write_path(is_inline_buffer, put_object_size, fi.erasure.block_size);
|
||||
let direct_inline_commit = matches!(write_path, SmallWritePath::Inline);
|
||||
// Buffered writers keep their shards in memory. Disk writers and
|
||||
// verification share the staged part path and its parent.
|
||||
let part_suffix = "/part.1";
|
||||
let tmp_object = if is_inline_buffer {
|
||||
String::new()
|
||||
} else {
|
||||
let mut uuid_buffer = Uuid::encode_buffer();
|
||||
let data_dir = data_dir.as_hyphenated().encode_lower(&mut uuid_buffer);
|
||||
[tmp_dir.as_str(), "/", data_dir, part_suffix].concat()
|
||||
};
|
||||
let tmp_data_dir = tmp_object.strip_suffix(part_suffix).unwrap_or_default();
|
||||
rustfs_io_metrics::record_put_object_path(write_path.metric_label());
|
||||
let writer_setup_stage_start = collect_stage_timing.then(Instant::now);
|
||||
let (mut writers, errors) = if direct_inline_commit {
|
||||
@@ -4873,47 +4886,42 @@ impl SetDisks {
|
||||
}
|
||||
(std::iter::repeat_with(|| None).take(shuffle_disks.len()).collect(), errors)
|
||||
} else {
|
||||
let writer_futs: Vec<_> = shuffle_disks
|
||||
.iter()
|
||||
.map(|disk_op| {
|
||||
let tmp_obj = tmp_object.clone();
|
||||
async move {
|
||||
if let Some(disk) = disk_op
|
||||
&& disk.is_online().await
|
||||
{
|
||||
match create_bitrot_writer_with_orig_volume(
|
||||
is_inline_buffer,
|
||||
Some(disk),
|
||||
bucket,
|
||||
RUSTFS_META_TMP_BUCKET,
|
||||
&tmp_obj,
|
||||
shard_file_size,
|
||||
frame_size,
|
||||
HashAlgorithm::HighwayHash256S,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(writer) => (Some(writer), None),
|
||||
Err(err) => {
|
||||
warn!(
|
||||
event = EVENT_SET_DISK_WRITE,
|
||||
component = LOG_COMPONENT_ECSTORE,
|
||||
subsystem = LOG_SUBSYSTEM_SET_DISK,
|
||||
disk = ?disk,
|
||||
state = "bitrot_writer_skipped",
|
||||
error = ?err,
|
||||
"Set disk bitrot writer skipped"
|
||||
);
|
||||
(None, Some(err))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
(None, Some(DiskError::DiskNotFound))
|
||||
let tmp_object = tmp_object.as_str();
|
||||
let writer_results = join_all(shuffle_disks.iter().map(|disk_op| async move {
|
||||
if let Some(disk) = disk_op
|
||||
&& disk.is_online().await
|
||||
{
|
||||
match create_bitrot_writer_with_orig_volume(
|
||||
is_inline_buffer,
|
||||
Some(disk),
|
||||
bucket,
|
||||
RUSTFS_META_TMP_BUCKET,
|
||||
tmp_object,
|
||||
shard_file_size,
|
||||
frame_size,
|
||||
HashAlgorithm::HighwayHash256S,
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(writer) => (Some(writer), None),
|
||||
Err(err) => {
|
||||
warn!(
|
||||
event = EVENT_SET_DISK_WRITE,
|
||||
component = LOG_COMPONENT_ECSTORE,
|
||||
subsystem = LOG_SUBSYSTEM_SET_DISK,
|
||||
disk = ?disk,
|
||||
state = "bitrot_writer_skipped",
|
||||
error = ?err,
|
||||
"Set disk bitrot writer skipped"
|
||||
);
|
||||
(None, Some(err))
|
||||
}
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
let writer_results = join_all(writer_futs).await;
|
||||
} else {
|
||||
(None, Some(DiskError::DiskNotFound))
|
||||
}
|
||||
}))
|
||||
.await;
|
||||
let mut writers = Vec::with_capacity(writer_results.len());
|
||||
let mut errors = Vec::with_capacity(writer_results.len());
|
||||
for (writer, error) in writer_results {
|
||||
@@ -5096,15 +5104,13 @@ impl SetDisks {
|
||||
// drop it below reconstructable quorum (backlog#852 / #799 B3).
|
||||
// `rename_data` re-checks write quorum over the surviving disks and
|
||||
// rolls back if too few remain.
|
||||
let committed_shards = if matches!(write_path, SmallWritePath::Inline) {
|
||||
shuffle_disks.iter().filter(|disk| disk.is_some()).count()
|
||||
} else {
|
||||
drop_failed_writer_disks(&mut shuffle_disks, &writers)
|
||||
};
|
||||
if committed_shards < write_quorum {
|
||||
return Err(Error::other(format!(
|
||||
"put_object write quorum unavailable after encode: {committed_shards} shard(s) committed, need {write_quorum}"
|
||||
)));
|
||||
if !direct_inline_commit {
|
||||
let committed_shards = drop_failed_writer_disks(&mut shuffle_disks, &writers);
|
||||
if committed_shards < write_quorum {
|
||||
return Err(Error::other(format!(
|
||||
"put_object write quorum unavailable after encode: {committed_shards} shard(s) committed, need {write_quorum}"
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
let part_integrity = if let Some(integrity) = integrity {
|
||||
@@ -5112,16 +5118,17 @@ impl SetDisks {
|
||||
integrity.set_inline_metadata(&mut fi)?;
|
||||
integrity.part
|
||||
} else {
|
||||
integrity
|
||||
.write(&mut shuffle_disks, bucket, RUSTFS_META_TMP_BUCKET, &tmp_data_dir)
|
||||
.await?
|
||||
let part = integrity
|
||||
.write(&mut shuffle_disks, bucket, RUSTFS_META_TMP_BUCKET, tmp_data_dir)
|
||||
.await?;
|
||||
if shuffle_disks.iter().filter(|disk| disk.is_some()).count() < write_quorum {
|
||||
return Err(Error::ErasureWriteQuorum);
|
||||
}
|
||||
part
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
if shuffle_disks.iter().filter(|disk| disk.is_some()).count() < write_quorum {
|
||||
return Err(Error::ErasureWriteQuorum);
|
||||
}
|
||||
if let Some(inline_proof) =
|
||||
rustfs_utils::http::get_consistent_str(&fi.metadata, rustfs_filemeta::shard_integrity::SUFFIX_INLINE_INTEGRITY)
|
||||
{
|
||||
@@ -5223,7 +5230,7 @@ impl SetDisks {
|
||||
WrittenBitrotShards::Inline(&parts_metadatas)
|
||||
} else {
|
||||
WrittenBitrotShards::Staged {
|
||||
directory: &tmp_data_dir,
|
||||
directory: tmp_data_dir,
|
||||
layout: &parts_metadatas[response_metadata_slot].erasure,
|
||||
part_size: w_size,
|
||||
}
|
||||
@@ -23186,8 +23193,9 @@ mod heterogeneous_pool_put_tests {
|
||||
hermetic_set_disks_isolated as hermetic_set_disks,
|
||||
};
|
||||
use super::*;
|
||||
use crate::config::storageclass::lookup_config_for_pools_without_env;
|
||||
use crate::config::storageclass::{OPTIMIZE_ENV, lookup_config_for_pools, lookup_config_for_pools_without_env};
|
||||
use crate::disk::ReadOptions;
|
||||
use crate::disk::health_state::RuntimeDriveHealthState;
|
||||
use crate::services::notification_sys::install_remote_version_state_fleet_proof_for_test;
|
||||
use rustfs_config::server_config::KVS;
|
||||
use serial_test::serial;
|
||||
@@ -23237,6 +23245,141 @@ mod heterogeneous_pool_put_tests {
|
||||
vec![fill; 1024 * 1024]
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[serial(storage_class_env)]
|
||||
async fn degraded_put_parity_persists_layout_and_preserves_commit_floor() {
|
||||
let (_temp_dirs, disk_stores, set_disks) = hermetic_set_disks_for_pool_with_default_parity(12, 0, 4).await;
|
||||
let bucket = "degraded-put-layout";
|
||||
make_bucket(&disk_stores, bucket).await;
|
||||
let kvs = KVS::new();
|
||||
let fixed = lookup_config_for_pools_without_env(&kvs, &[12]).expect("default storage class should resolve");
|
||||
let upgraded = temp_env::with_vars(
|
||||
[
|
||||
(OPTIMIZE_ENV, Some("degraded_put_parity")),
|
||||
(crate::config::storageclass::STANDARD_ENV, None),
|
||||
(crate::config::storageclass::RRS_ENV, None),
|
||||
(crate::config::storageclass::INLINE_BLOCK_ENV, None),
|
||||
],
|
||||
|| lookup_config_for_pools(&kvs, &[12]).expect("opt-in storage class should resolve"),
|
||||
);
|
||||
let opts = ObjectOptions {
|
||||
write_completion: WriteCompletion::TailDrained,
|
||||
..Default::default()
|
||||
};
|
||||
let payload = [large_payload(0x3c), large_payload(0xa7)].concat();
|
||||
let put = |object| {
|
||||
let mut reader = PutObjReader::from_vec(payload.clone());
|
||||
let set = &set_disks;
|
||||
let opts = &opts;
|
||||
async move { set.put_object(bucket, object, &mut reader, opts).await }
|
||||
};
|
||||
let check_layout = |object, data, parity, first_missing| {
|
||||
let disks = &disk_stores;
|
||||
async move {
|
||||
for (index, disk) in disks.iter().enumerate() {
|
||||
let stored = disk.read_version("", bucket, object, "", &ReadOptions::default()).await;
|
||||
if index < first_missing {
|
||||
let fi = stored.expect("participating drive should persist object metadata");
|
||||
assert_eq!(
|
||||
(fi.erasure.data_blocks, fi.erasure.parity_blocks),
|
||||
(data, parity),
|
||||
"{object}, slot {index}"
|
||||
);
|
||||
let data_dir = fi.data_dir.expect("test object should be stored out-of-line");
|
||||
assert!(data_dir_exists(disk, bucket, object, data_dir).await, "{object}, slot {index}");
|
||||
} else {
|
||||
assert!(matches!(stored, Err(DiskError::FileNotFound)), "{object}, slot {index}: {stored:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
set_disks.set_test_storage_class_config(upgraded.clone());
|
||||
put("healthy").await.expect("healthy PUT should commit");
|
||||
check_layout("healthy", 8, 4, 12).await;
|
||||
|
||||
let barrier = PutObjectCommitBarrier::install(bucket, "late-failure", PutObjectCommitPause::AfterNamespace);
|
||||
let late_put = put("late-failure");
|
||||
let (_, result) = tokio::join!(
|
||||
async {
|
||||
barrier.wait_until_paused().await;
|
||||
disk_stores[11].force_runtime_state_for_test(RuntimeDriveHealthState::Offline);
|
||||
barrier.release();
|
||||
},
|
||||
late_put,
|
||||
);
|
||||
result.expect("the remaining drives should commit after a late failure");
|
||||
disk_stores[11].force_runtime_state_for_test(RuntimeDriveHealthState::Online);
|
||||
check_layout("late-failure", 8, 4, 11).await;
|
||||
|
||||
set_disks.set_test_storage_class_config(fixed.clone());
|
||||
set_disks.disks.write().await[11] = None;
|
||||
put("fixed").await.expect("fixed-layout PUT should commit with 11 drives");
|
||||
check_layout("fixed", 8, 4, 11).await;
|
||||
|
||||
set_disks.set_test_storage_class_config(upgraded);
|
||||
set_disks.disks.write().await[11] = Some(disk_stores[11].clone());
|
||||
let disk = &disk_stores[11];
|
||||
disk.force_runtime_state_for_test(RuntimeDriveHealthState::Offline);
|
||||
put("upgraded-while-offline")
|
||||
.await
|
||||
.expect("a known offline handle should raise parity");
|
||||
let crate::disk::Disk::Local(local) = disk.as_ref() else {
|
||||
panic!("the hermetic disk must be local");
|
||||
};
|
||||
assert!(!local.mark_recovery_success_for_test());
|
||||
assert_eq!(disk.runtime_state(), RuntimeDriveHealthState::Returning);
|
||||
assert!(!disk.is_online().await);
|
||||
put("upgraded")
|
||||
.await
|
||||
.expect("a recovering handle still blocked for I/O should raise parity");
|
||||
disk_stores[11].force_runtime_state_for_test(RuntimeDriveHealthState::Online);
|
||||
check_layout("upgraded-while-offline", 7, 5, 11).await;
|
||||
check_layout("upgraded", 7, 5, 11).await;
|
||||
|
||||
set_disks.disks.write().await[8..].fill(None);
|
||||
put("capped").await.expect("eight commits should satisfy the original quorum");
|
||||
check_layout("capped", 6, 6, 8).await;
|
||||
|
||||
let barrier = PutObjectCommitBarrier::install(bucket, "commit-below-floor", PutObjectCommitPause::AfterNamespace);
|
||||
let (_, result) = tokio::join!(
|
||||
async {
|
||||
barrier.wait_until_paused().await;
|
||||
disk_stores[7].force_runtime_state_for_test(RuntimeDriveHealthState::Offline);
|
||||
barrier.release();
|
||||
},
|
||||
put("commit-below-floor"),
|
||||
);
|
||||
result.expect_err("losing the eighth drive after encoding must abort the commit");
|
||||
disk_stores[7].force_runtime_state_for_test(RuntimeDriveHealthState::Online);
|
||||
check_layout("commit-below-floor", 0, 0, 0).await;
|
||||
|
||||
set_disks.disks.write().await[7] = None;
|
||||
put("below-floor")
|
||||
.await
|
||||
.expect_err("seven commits must not satisfy the original eight-drive quorum");
|
||||
check_layout("below-floor", 0, 0, 0).await;
|
||||
|
||||
set_disks.set_test_storage_class_config(fixed);
|
||||
let mut object_reader = set_disks
|
||||
.get_object_reader(bucket, "upgraded", None, HeaderMap::new(), &opts)
|
||||
.await
|
||||
.expect("seven remaining shards should serve the upgraded object after disabling the option");
|
||||
let mut restored = Vec::new();
|
||||
object_reader
|
||||
.stream
|
||||
.read_to_end(&mut restored)
|
||||
.await
|
||||
.expect("upgraded object should stream");
|
||||
assert_eq!(restored, payload);
|
||||
assert!(
|
||||
set_disks
|
||||
.get_object_reader(bucket, "fixed", None, HeaderMap::new(), &opts)
|
||||
.await
|
||||
.is_err()
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn second_pool_regular_put_uses_its_own_layout_and_round_trips() {
|
||||
// Deliberately inject the first pool's invalid scalar fallback. The
|
||||
|
||||
@@ -85,7 +85,7 @@ Two storage classes: `STANDARD` (SC) and `REDUCED_REDUNDANCY` (RRS) ([storagecla
|
||||
- **INVARIANT — per-pool validity.** Each pool's resolved parity must be valid for **that pool's own drive count**. A heterogeneous deployment (pools of different widths) must resolve parity per pool; applying one pool's parity to a narrower pool can drive `data_blocks = N − parity` to `0` and make encoding impossible.
|
||||
- Implemented by `resolve_write_layout` ([set_disk/mod.rs](../../crates/ecstore/src/set_disk/mod.rs)), which takes the pool index and resolves parity against that pool's own drive count; the default parity for a pool without explicit config comes from `ec_drives_no_config` ([store/init_format.rs](../../crates/ecstore/src/store/init_format.rs)).
|
||||
|
||||
Per-write layout (the numbers that go into `xl.meta`), from the storage class or `default_parity_count`, with `opts.max_parity` forcing `N/2` for internal writes ([set_disk/ops/object.rs](../../crates/ecstore/src/set_disk/ops/object.rs)):
|
||||
The baseline write layout comes from the storage class or `default_parity_count`, with `opts.max_parity` forcing `N/2` for internal writes ([set_disk/ops/object.rs](../../crates/ecstore/src/set_disk/ops/object.rs)):
|
||||
|
||||
```
|
||||
parity_drives = storage_class_parity(x-amz-storage-class) or set default_parity_count
|
||||
@@ -94,7 +94,9 @@ data_drives = N − parity_drives
|
||||
write_quorum = data_drives ; if data_drives == parity_drives: write_quorum += 1
|
||||
```
|
||||
|
||||
- **INVARIANT — layout arithmetic.** `data_blocks = N − parity`; `read_quorum = data_blocks`; `write_quorum = data_blocks`, bumped to `data_blocks + 1` iff `data_blocks == parity_blocks` (so a symmetric split cannot commit on a bare data-quorum). See [core/io_primitives.rs](../../crates/ecstore/src/set_disk/core/io_primitives.rs) (`default_read_quorum`, `default_write_quorum`).
|
||||
- **INVARIANT — layout arithmetic.** `data_blocks = N − parity`. The layout read quorum is `data_blocks` and the layout write quorum is `data_blocks + 1` for a symmetric split, or `data_blocks` otherwise. See [core/io_primitives.rs](../../crates/ecstore/src/set_disk/core/io_primitives.rs) (`default_read_quorum`, `default_write_quorum`).
|
||||
|
||||
With [degraded PUT parity enabled](../operations/cluster-lifecycle-operations.md#3-startup-configuration), eligible PUTs may select higher parity before encoding. They persist the selected geometry in `xl.meta` and require at least the baseline write quorum to acknowledge the PUT.
|
||||
|
||||
---
|
||||
|
||||
@@ -389,7 +391,7 @@ Version-aware heal ([set_disk/ops/heal.rs](../../crates/ecstore/src/set_disk/ops
|
||||
|-----------|--------|--------|
|
||||
| Read (payload) | `data_blocks = N − parity` | [set_disk/metadata.rs](../../crates/ecstore/src/set_disk/metadata.rs) |
|
||||
| Decode (shards needed) | `≥ data_blocks` | [set_disk/read.rs](../../crates/ecstore/src/set_disk/read.rs) |
|
||||
| Write (payload) | `data_blocks`, `+1` iff `data == parity` | [set_disk/core/io_primitives.rs](../../crates/ecstore/src/set_disk/core/io_primitives.rs) |
|
||||
| Write (payload) | `data_blocks`, `+1` iff `data == parity`. Degraded PUT parity retains the baseline PUT commit floor. | [Parity selection](#22-parity-selection) |
|
||||
| Delete marker (write + metadata vote) | `N/2 + 1` (majority) | [set_disk/ops/object.rs](../../crates/ecstore/src/set_disk/ops/object.rs), [set_disk/metadata.rs](../../crates/ecstore/src/set_disk/metadata.rs) |
|
||||
| `opts.max_parity` internal writes | parity `= N/2` | [set_disk/ops/object.rs](../../crates/ecstore/src/set_disk/ops/object.rs) |
|
||||
|
||||
@@ -425,8 +427,8 @@ Do not change any of the following without a format-version bump, a read path fo
|
||||
|
||||
Geometry & math
|
||||
- Set size `N ∈ 2..=16` for multi-drive layouts (single-drive deployments run at `N = 1`, parity 0); `N = data_blocks + parity_blocks`.
|
||||
- `parity ≤ N/2`; `STANDARD parity ≥ RRS parity`; parity resolved **per pool** for its own `N`.
|
||||
- `read_quorum = data_blocks`; `write_quorum = data_blocks` (`+1` iff `data == parity`); delete-marker quorum `N/2 + 1`.
|
||||
- `parity ≤ N/2`; configured `STANDARD parity ≥ RRS parity` when both are non-zero; baseline parity resolved **per pool** for its own `N`.
|
||||
- `read_quorum = data_blocks`; layout write quorum `data_blocks` (`+1` iff `data == parity`); delete-marker quorum `N/2 + 1`. A new PUT that raises parity retains the baseline write quorum as its commit floor.
|
||||
- Decode requires `≥ data_blocks` shards; below that, fail closed. Writes missing quorum roll back (best-effort — see §7).
|
||||
|
||||
Algorithm
|
||||
|
||||
@@ -59,10 +59,12 @@ A single local path (`rustfs D:\rustfs\data`) is a single-node single-drive depl
|
||||
| `RUSTFS_ERASURE_SET_DRIVE_COUNT` | Pin the set width | Must be a valid symmetric divisor of the pool, at most `MAX_ERASURE_SET_DRIVE_COUNT` (16); cannot change an initialized pool |
|
||||
| `RUSTFS_STORAGE_CLASS_STANDARD` | STANDARD parity as `EC:<n>` | Validated per pool; affects new writes only |
|
||||
| `RUSTFS_STORAGE_CLASS_RRS` | RRS parity as `EC:<n>` | Validated per pool; an explicit value fails on a single drive, the persisted default `EC:1` resolves to `0` there |
|
||||
| `RUSTFS_STORAGE_CLASS_OPTIMIZE` | Accepted for MinIO compatibility | Stored on `Config`, but `Config::capacity_optimized` has no caller: it changes nothing at runtime today |
|
||||
| `RUSTFS_STORAGE_CLASS_OPTIMIZE` | Set to `degraded_put_parity` to opt in | Increases parity for eligible object PUTs when the writer already knows about offline drives. Unset, `availability`, and `capacity` retain fixed layouts |
|
||||
| `RUSTFS_STORAGE_CLASS_INLINE_BLOCK` | Fixed per-shard inline limit (bytesize syntax such as `128KiB`) | Overrides the fixed 128 KiB default in §4.3. Values above 128 KiB log `storage_class_inline_block_large` |
|
||||
|
||||
An empty `RUSTFS_STORAGE_CLASS_STANDARD` or `RUSTFS_STORAGE_CLASS_RRS` restores the automatic policy and overrides a persisted value (`standard_policy` / `rrs_policy`). `MINIO_`-prefixed spellings of these keys, of `ERASURE_SET_DRIVE_COUNT`, and of `VOLUMES` are mapped onto the `RUSTFS_` names when the `RUSTFS_` name is unset (`apply_external_env_compat` in `crates/utils/src/envs.rs`); when both are set the `RUSTFS_` value wins and the conflict is reported at startup.
|
||||
An empty `RUSTFS_STORAGE_CLASS_STANDARD` or `RUSTFS_STORAGE_CLASS_RRS` restores the automatic policy and overrides a persisted value (`standard_policy` / `rrs_policy`). `MINIO_`-prefixed spellings of these keys, of `STORAGE_CLASS_OPTIMIZE`, of `ERASURE_SET_DRIVE_COUNT`, and of `VOLUMES` are mapped onto the `RUSTFS_` names when the `RUSTFS_` name is unset (`apply_external_env_compat` in `crates/utils/src/envs.rs`); when both are set the `RUSTFS_` value wins and the conflict is reported at startup.
|
||||
|
||||
Degraded PUT parity is a process environment setting. Set it on every write coordinator to apply the policy consistently. An eligible PUT adds one parity shard for each missing slot or drive whose cached health blocks foreground I/O in the writer's erasure set, capped at half the set width. A recovering drive can still be blocked until it returns online. The selected geometry is stored with the object and is fixed before encoding. A 12-drive `EC:4` PUT with one known offline slot selects `7+5` and still requires at least eight commits. If all 11 available shards commit, seven surviving shards can serve reads when the cluster can admit the request. Higher parity increases shard size and storage use on affected writes. Multipart uploads, internal metadata, restore and internal data movement, and writes with zero configured parity (including zero-parity pools) retain their existing policy. Unsetting the option restores fixed layouts for future writes.
|
||||
|
||||
Heal knobs (`RUSTFS_HEAL_*`) and their defaults are documented once, in [scanner-runtime-controls.md](scanner-runtime-controls.md#heal-runtime-controls); the deep bitrot cycle is the admin config key `heal.bitrot_cycle` (environment `RUSTFS_SCANNER_BITROT_CYCLE_SECS`), not a `RUSTFS_HEAL_*` variable. Data-movement knobs: `RUSTFS_REBALANCE_MAX_ATTEMPTS` (default `DEFAULT_REBALANCE_MAX_ATTEMPTS` = 3, `crates/ecstore/src/services/rebalance/mod.rs`), `RUSTFS_DECOMMISSION_BUCKET_CONCURRENCY` (default cap 4) and `RUSTFS_DECOMMISSION_ENTRY_CONCURRENCY` (default cap 8, hard cap 64) in `crates/ecstore/src/core/pools.rs`, and `RUSTFS_LIST_OBJECTS_QUORUM` (default `strict`, which reads every online drive of the set; `disk`, `reduced`, `optimal` and `auto` read a sample, and anything else means `strict`, per `normalize_list_quorum` in `crates/ecstore/src/store/list_objects.rs`). `strict` reads all online drives, but resolves entries using a quorum of those drives. After a successful delete, a change in which drives are offline can leave enough stale copies online for the deleted key to reappear in LIST; GET or HEAD can return 404 or 503. Restore the drives and allow healing to complete before relying on degraded listings for backup, sync, replication, or lifecycle work. `optimal` samples about half the drives and can also omit a committed object whose copies mostly sit outside the sample: an `EC:8` object committed on nine of sixteen drives can miss a four-copy sample quorum. `disk` and `reduced` sample fewer drives and encounter these limits more often. Keep the default `strict` for work that needs a complete listing, while accounting for the degraded-drive limitation above. None of these settings changes object read or write quorum.
|
||||
|
||||
@@ -95,7 +97,7 @@ Validation (`validate_parity_inner`): each parity is at most `N/2` for every poo
|
||||
```text
|
||||
usable capacity ≈ raw × K / N
|
||||
read quorum = K (metadata vote and shard decode)
|
||||
write quorum = K, or K + 1 when K == M
|
||||
layout write quorum = K, or K + 1 when K == M
|
||||
delete markers = N/2 + 1 (majority, both write and vote)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user