mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 02:33:15 +00:00
06eeb886f8
Consumer half of the mission repair feed: a bounded pending queue
(100k intents / 8 MiB dual ceiling, drop-newest on overflow), a durable
journal at buckets/.heal/mrf/journal.bin holding the unaccepted pending
snapshot, and a consumer task that batches intents off the global
channel, translates them into prioritized heal requests (decode
failure -> Urgent ECDecode, metadata corruption -> High Metadata,
partial write -> Normal object heal), and retries full admissions with
a 5s backoff and a 3-attempt ceiling.
Durability: every journal record carries its own CRC32 and a
format/version header, so a torn tail truncates cleanly at replay; the
journal is deleted after a successful replay and when the pending set
drains (mirroring MinIO's post-replay list.bin unlink). Losing the last
500 ms flush window is acceptable: replayed duplicates merge via the
manager dedup key and read-repair remains the safety net.
Metrics: rustfs_heal_mrf_queue_depth/_queue_bytes, _dropped_total
{reason}, _replayed_total, _journal_bytes, _journal_fsync_total.
The consumer is wired at heal runtime bootstrap right after manager
start, honoring RUSTFS_HEAL_MRF_ENABLE (default on, rollback = off).
Tests: unit tests for the dual ceiling, record roundtrip, torn-tail
truncation, and the priority mapping; integration tests against a real
4-disk ECStore proving channel intents reach the manager queue as
Urgent/mrf-attributed requests and journal replay arms intents, drops
torn tails, and removes the file.
Part of backlog#1865 (option a).
Co-Authored-By: heihutu <heihutu@gmail.com>
107 lines
3.4 KiB
TOML
107 lines
3.4 KiB
TOML
# Copyright 2024 RustFS Team
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
[package]
|
|
name = "rustfs-heal"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
authors = ["RustFS Team"]
|
|
license.workspace = true
|
|
description = "RustFS erasure set and object healing"
|
|
repository.workspace = true
|
|
rust-version.workspace = true
|
|
homepage.workspace = true
|
|
documentation = "https://docs.rs/rustfs-heal/latest/rustfs_heal/"
|
|
keywords = ["RustFS", "heal", "erasure-coding", "Minio"]
|
|
categories = ["web-programming", "development-tools", "filesystem"]
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[features]
|
|
default = []
|
|
hotpath = [
|
|
"hotpath/hotpath",
|
|
"hotpath/tokio",
|
|
"hotpath/futures",
|
|
"rustfs-common/hotpath",
|
|
"rustfs-concurrency/hotpath",
|
|
"rustfs-config/hotpath",
|
|
"rustfs-ecstore/hotpath",
|
|
"rustfs-madmin/hotpath",
|
|
"rustfs-storage-api/hotpath",
|
|
"rustfs-utils/hotpath",
|
|
"rustfs-test-utils/hotpath",
|
|
]
|
|
hotpath-alloc = [
|
|
"hotpath",
|
|
"hotpath/hotpath-alloc",
|
|
"rustfs-common/hotpath-alloc",
|
|
"rustfs-concurrency/hotpath-alloc",
|
|
"rustfs-config/hotpath-alloc",
|
|
"rustfs-ecstore/hotpath-alloc",
|
|
"rustfs-madmin/hotpath-alloc",
|
|
"rustfs-storage-api/hotpath-alloc",
|
|
"rustfs-utils/hotpath-alloc",
|
|
"rustfs-test-utils/hotpath-alloc",
|
|
]
|
|
hotpath-cpu = [
|
|
"hotpath",
|
|
"hotpath/hotpath-cpu",
|
|
"rustfs-common/hotpath-cpu",
|
|
"rustfs-concurrency/hotpath-cpu",
|
|
"rustfs-config/hotpath-cpu",
|
|
"rustfs-ecstore/hotpath-cpu",
|
|
"rustfs-madmin/hotpath-cpu",
|
|
"rustfs-storage-api/hotpath-cpu",
|
|
"rustfs-utils/hotpath-cpu",
|
|
"rustfs-test-utils/hotpath-cpu",
|
|
]
|
|
|
|
[dependencies]
|
|
hotpath.workspace = true
|
|
rustfs-config = { workspace = true }
|
|
rustfs-concurrency = { workspace = true }
|
|
rustfs-ecstore = { workspace = true }
|
|
rustfs-storage-api = { workspace = true }
|
|
rustfs-common = { workspace = true }
|
|
rustfs-madmin = { workspace = true }
|
|
rustfs-utils = { workspace = true }
|
|
tokio = { workspace = true, features = ["sync", "io-util", "time", "macros", "fs", "rt-multi-thread"] }
|
|
tokio-util = { workspace = true, features = ["io", "compat"] }
|
|
tracing = { workspace = true }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = { workspace = true, features = ["raw_value"] }
|
|
thiserror = { workspace = true }
|
|
uuid = { workspace = true, features = ["v4", "serde", "fast-rng", "macro-diagnostics"] }
|
|
async-trait = { workspace = true }
|
|
futures = { workspace = true }
|
|
metrics = { workspace = true }
|
|
base64 = { workspace = true }
|
|
bytes = { workspace = true }
|
|
crc-fast = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
serde_json = { workspace = true, features = ["raw_value"] }
|
|
rustfs-test-utils = { workspace = true }
|
|
serial_test = { workspace = true }
|
|
tempfile = { workspace = true }
|
|
walkdir = { workspace = true }
|
|
http = { workspace = true }
|
|
temp-env = { workspace = true, features = ["async_closure"] }
|
|
tokio = { workspace = true, features = ["test-util", "fs", "rt-multi-thread"] }
|
|
|
|
[lib]
|
|
doctest = false
|