Compare commits

..

1 Commits

Author SHA1 Message Date
Zhengchao An 10967d0815 fix(log-analyzer): track storage probe failures (#7434)
* fix(log-analyzer): track storage probe failures

* fix(error): merge equivalent api message branches

Co-Authored-By: heihutu <heihutu@gmail.com>

Co-Authored-By: zhi22915 <qiuzgang@gmail.com>

---------

Co-authored-by: houseme <housemecn@gmail.com>
Co-authored-by: zhi22915 <qiuzgang@gmail.com>
2026-09-07 20:32:06 +00:00
4 changed files with 29 additions and 11 deletions
+7 -4
View File
@@ -68,14 +68,17 @@ pub(super) fn rules() -> Vec<Rule> {
)
},
Rule {
anchors: strings(["reporting peer disks offline after consecutive storage_info failures"]),
anchors: strings(["Storage inventory probe failed; current drive health is unknown"]),
..base(
"peer-disks-offline",
P2Degraded,
"disk",
"peer 磁盘被整体判定离线",
contains("reporting peer disks offline after consecutive storage_info failures"),
"对某 peer 连续 storage_info 失败,判定其磁盘整体离线。",
"peer 存储清单探测失败",
any([
contains("Storage inventory probe failed; current drive health is unknown"),
contains("reporting peer disks offline after consecutive storage_info failures"),
]),
"某 peer 的 storage_info 探测失败,当前磁盘健康状态未知。",
"检查该 peer 节点存活与 RPC 端口可达。",
)
},
+5 -1
View File
@@ -110,7 +110,7 @@ fn every_rule_has_a_positive_sample() {
("remote-peer-faulty", msg("Remote peer health check failed for node2: marking as faulty")),
(
"peer-disks-offline",
msg("reporting peer disks offline after consecutive storage_info failures"),
msg("Storage inventory probe failed; current drive health is unknown"),
),
("drive-faulty-error", msg("remote drive is faulty")),
(
@@ -318,6 +318,10 @@ fn smoke_samples_hit_exact_rule_sets() {
&["disk-marked-faulty"],
);
exact(&msg("erasure write quorum (required=8, achieved=5)"), &["ec-write-quorum"]);
exact(
&msg("reporting peer disks offline after consecutive storage_info failures"),
&["peer-disks-offline"],
);
exact(
&Sample {
message: "Metacache listing quorum failed",
+11
View File
@@ -988,6 +988,17 @@ pub async fn init_scanner_with_recovery(
return None;
}
Some(tokio::spawn(async move {
if let Err(error) = run_scanner_usage_recovery_intents_for_startup(ctx.clone(), storeapi.clone()).await {
warn!(
target: "rustfs::scanner",
event = EVENT_SCANNER_PERSIST_STATE,
component = LOG_COMPONENT_SCANNER,
subsystem = LOG_SUBSYSTEM_RUNTIME,
state = "recovery_intent_startup_discovery_failed",
error = %error,
"Disabled scanner recovery intent startup discovery failed"
);
}
if let Err(error) = resume_scanner_cycle_cleanup(ctx, storeapi).await {
warn!(
target: "rustfs::scanner",
@@ -457,7 +457,7 @@ async fn scanner_recovery_intent_startup_rejects_corrupt_pending_record() {
#[tokio::test]
#[serial]
async fn scanner_recovery_intent_disabled_startup_preserves_non_terminal_intent() {
async fn scanner_recovery_intent_disabled_startup_executes_persisted_non_terminal_intent() {
let (_dir, store) = setup_scanner_cycle_store().await;
let record = match accept_scanner_usage_recovery_intent(
store.clone(),
@@ -473,12 +473,12 @@ async fn scanner_recovery_intent_disabled_startup_preserves_non_terminal_intent(
let restarted = restart_scanner_cycle_store_from(&store).await;
run_disabled_startup(CancellationToken::new(), restarted.clone()).await;
let preserved = get_scanner_usage_recovery_intent(restarted, &record.intent_id)
let completed = get_scanner_usage_recovery_intent(restarted, &record.intent_id)
.await
.expect("startup-skipped intent should read")
.expect("startup-skipped intent should remain durable");
assert_eq!(preserved.state, "accepted");
assert_eq!(preserved.intent_id, record.intent_id);
.expect("startup-executed intent should read")
.expect("startup-executed intent should remain durable");
assert_eq!(completed.state, "completed");
assert_eq!(completed.intent_id, record.intent_id);
}
#[tokio::test]