From d0224d53f6d78822731e76ce2462a0ed1f1e08d4 Mon Sep 17 00:00:00 2001 From: yuyr Date: Mon, 8 Jun 2026 13:23:16 +0800 Subject: [PATCH] =?UTF-8?q?20260608=20=E9=BB=98=E8=AE=A4rsync=20scope?= =?UTF-8?q?=E5=88=87=E5=88=B0module-root?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/soak/portable-soak.env.example | 6 +++--- scripts/soak/run_soak.sh | 2 +- src/cli.rs | 2 +- src/fetch/rsync_system.rs | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/soak/portable-soak.env.example b/scripts/soak/portable-soak.env.example index ecfef11..f6133f9 100644 --- a/scripts/soak/portable-soak.env.example +++ b/scripts/soak/portable-soak.env.example @@ -26,10 +26,10 @@ OUTPUT_COMPACT_REPORT=1 ALLOW_RSYNC_MIRROR_REUSE=1 # rsync 同步/去重 scope。 +# module-root 表示扩大实际拉取到 rsync module 根目录,并在同一 module 下复用成功拉取结果; # host 表示按 rsync host 做失败短路,但实际拉取仍限定当前发布点,避免同一不可达 host 重复等待超时; -# publication-point 表示只按当前发布点去重; -# module-root 表示扩大实际拉取到 rsync module 根目录。 -RSYNC_SCOPE=host +# publication-point 表示只按当前发布点去重。 +RSYNC_SCOPE=module-root # 前一轮失败或不完整时,是否隔离旧数据库和运行态目录后强制下一轮 snapshot。 # 建议保持 1;设置为 0 时,检测到前一轮失败会直接停止。 diff --git a/scripts/soak/run_soak.sh b/scripts/soak/run_soak.sh index 3e67589..03467d7 100755 --- a/scripts/soak/run_soak.sh +++ b/scripts/soak/run_soak.sh @@ -17,7 +17,7 @@ RUN_ROOT="${RUN_ROOT:-$PACKAGE_ROOT}" RETAIN_RUNS="${RETAIN_RUNS:-10}" OUTPUT_COMPACT_REPORT="${OUTPUT_COMPACT_REPORT:-1}" ALLOW_RSYNC_MIRROR_REUSE="${ALLOW_RSYNC_MIRROR_REUSE:-1}" -RSYNC_SCOPE="${RSYNC_SCOPE:-host}" +RSYNC_SCOPE="${RSYNC_SCOPE:-module-root}" FAILURE_SNAPSHOT_RESET="${FAILURE_SNAPSHOT_RESET:-1}" DB_STATS_EXACT_EVERY="${DB_STATS_EXACT_EVERY:-3}" RPKI_PROGRESS_LOG="${RPKI_PROGRESS_LOG:-1}" diff --git a/src/cli.rs b/src/cli.rs index f0df9a9..723252d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -233,7 +233,7 @@ Options: --http-timeout-secs HTTP fetch timeout seconds (default: 20) --rsync-timeout-secs rsync I/O timeout seconds (default: 60) --rsync-mirror-root Persist rsync mirrors under this directory (default: disabled) - --rsync-scope rsync scope policy: host, publication-point, or module-root (default: host) + --rsync-scope rsync scope policy: host, publication-point, or module-root (default: module-root) --max-depth Max CA instance depth (0 = root only) --max-instances Max number of CA instances to process --validation-time Validation time in RFC3339 (default: now UTC) diff --git a/src/fetch/rsync_system.rs b/src/fetch/rsync_system.rs index f2da3f6..a44f5cb 100644 --- a/src/fetch/rsync_system.rs +++ b/src/fetch/rsync_system.rs @@ -22,7 +22,7 @@ pub enum RsyncScopePolicy { impl Default for RsyncScopePolicy { fn default() -> Self { - Self::Host + Self::ModuleRoot } } @@ -563,15 +563,15 @@ mod tests { } #[test] - fn system_rsync_dedup_key_uses_host_scope_by_default() { + fn system_rsync_dedup_key_uses_module_root_by_default() { let fetcher = SystemRsyncFetcher::new(SystemRsyncConfig::default()); assert_eq!( fetcher.dedup_key("rsync://example.net/repo/ta/ca/publication-point/"), - "rsync://example.net/repo/ta/ca/publication-point/" + "rsync://example.net/repo/" ); assert_eq!( fetcher.failure_dedup_key("rsync://example.net/repo/ta/ca/publication-point/"), - Some("rsync://example.net/".to_string()) + None ); }