From c79bb20b0079cc56b96286d96636ff3b2f17e521 Mon Sep 17 00:00:00 2001 From: houseme Date: Tue, 30 Jun 2026 00:11:22 +0800 Subject: [PATCH] fix: avoid moved fields in list_path logging --- crates/ecstore/src/store/list_objects.rs | 16 +++++++++------- scripts/validate_issue_785_list_objects.sh | 22 +++++++++++++++------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/crates/ecstore/src/store/list_objects.rs b/crates/ecstore/src/store/list_objects.rs index 3bbdd64e7..62d0001e6 100644 --- a/crates/ecstore/src/store/list_objects.rs +++ b/crates/ecstore/src/store/list_objects.rs @@ -2956,11 +2956,13 @@ impl SetDisks { fallback_disks = disks.split_off(ask_disks as usize); } - let resolver = list_metadata_resolution_params(opts.bucket.clone(), listing_quorum, opts.versioned); + let bucket = opts.bucket.clone(); + let base_dir = opts.base_dir.clone(); + let resolver = list_metadata_resolution_params(bucket.clone(), listing_quorum, opts.versioned); debug!( - bucket = %opts.bucket, - prefix = %opts.base_dir, + bucket = %bucket, + prefix = %base_dir, set_drive_count = self.set_drive_count, asked_disks = ask_disks, listing_quorum = listing_quorum, @@ -3036,8 +3038,8 @@ impl SetDisks { if let Err(ref err) = result { debug!( - bucket = %opts.bucket, - path = %opts.base_dir, + bucket = %bucket, + path = %base_dir, disk_count = disks.len(), fallback_disks = fallback_disks.len(), asked_disks = ask_disks, @@ -3048,8 +3050,8 @@ impl SetDisks { ); } else { debug!( - bucket = %opts.bucket, - path = %opts.base_dir, + bucket = %bucket, + path = %base_dir, disk_count = disks.len(), fallback_disks = fallback_disks.len(), asked_disks = ask_disks, diff --git a/scripts/validate_issue_785_list_objects.sh b/scripts/validate_issue_785_list_objects.sh index a3e8a333f..0931c738e 100755 --- a/scripts/validate_issue_785_list_objects.sh +++ b/scripts/validate_issue_785_list_objects.sh @@ -35,13 +35,21 @@ run_unit_checks() { mkdir -p "$OUT_DIR" local test_log="$OUT_DIR/issue-785-ecstore-tests.log" - (cd "$PROJECT_ROOT" && cargo test -p rustfs-ecstore \ - list_path_gather_results_returns_after_limit_without_waiting_for_input_close \ - list_path_gather_results_keeps_marker_entry_for_version_marker_listing \ - list_path_gather_results_skips_marker_entry_by_default \ - normalize_list_quorum_falls_back_to_strict \ - list_objects_quorum_from_env_defaults_to_optimal \ - -- --nocapture | tee "$test_log") + : > "$test_log" + + local tests=( + list_path_gather_results_returns_after_limit_without_waiting_for_input_close + list_path_gather_results_keeps_marker_entry_for_version_marker_listing + list_path_gather_results_skips_marker_entry_by_default + normalize_list_quorum_falls_back_to_strict + list_objects_quorum_from_env_defaults_to_optimal + ) + + local test + for test in "${tests[@]}"; do + echo "[TEST] $test" | tee -a "$test_log" + (cd "$PROJECT_ROOT" && cargo test -p rustfs-ecstore "$test" -- --nocapture | tee -a "$test_log") + done log_info "Unit test log: $test_log" }