diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a656b1819..6f52bf974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,8 +39,8 @@ jobs: - uses: actions/checkout@v4.2.2 - uses: ./.github/actions/setup - - name: Format Check - run: cargo fmt --all --check + # - name: Format Check + # run: cargo fmt --all --check - name: Lint Check run: cargo check --all-targets @@ -51,22 +51,23 @@ jobs: - name: Unit Tests run: cargo test --all --exclude e2e_test - develop: - needs: skip-check + - name: Format Code + run: cargo fmt --all + + s3s-e2e: + name: E2E (s3s-e2e) + needs: + - skip-check + - develop if: needs.skip-check.outputs.should_skip != 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.2.2 - - uses: ./.github/actions/setup - - - name: Format - run: cargo fmt --all --check - - - name: Lint - run: cargo check --all-targets - - - name: Clippy - run: cargo clippy --all-targets --all-features -- -D warnings + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + cache-on-failure: true + cache-all-crates: true - name: Test run: cargo test --all --exclude e2e_test @@ -86,21 +87,6 @@ jobs: name: rustfs path: ./target/artifacts/* - s3s-e2e: - name: E2E (s3s-e2e) - needs: - - skip-check - - develop - if: needs.skip-check.outputs.should_skip != 'true' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4.2.2 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - cache-all-crates: true - - name: Install s3s-e2e run: | cargo install s3s-e2e --git https://github.com/Nugine/s3s.git @@ -120,3 +106,22 @@ jobs: with: name: s3s-e2e.logs path: /tmp/rustfs.log + + + + develop: + needs: skip-check + if: needs.skip-check.outputs.should_skip != 'true' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.2.2 + - uses: ./.github/actions/setup + + - name: Format + run: cargo fmt --all --check + + - name: Lint + run: cargo check --all-targets + + - name: Clippy + run: cargo clippy --all-targets --all-features -- -D warnings diff --git a/Cargo.lock b/Cargo.lock index c8ed41b98..6733a7bc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1684,9 +1684,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", "clap_derive", @@ -1694,9 +1694,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -1706,9 +1706,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.32" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" dependencies = [ "heck 0.5.0", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index b85f45569..c2751f6b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,7 +81,7 @@ byteorder = "1.5.0" cfg-if = "1.0.0" chacha20poly1305 = { version = "0.10.1" } chrono = { version = "0.4.41", features = ["serde"] } -clap = { version = "4.5.39", features = ["derive", "env"] } +clap = { version = "4.5.40", features = ["derive", "env"] } config = "0.15.11" const-str = { version = "0.6.2", features = ["std", "proc"] } crc32fast = "1.4.2" @@ -192,7 +192,7 @@ serde_urlencoded = "0.7.1" serde_with = "3.12.0" sha2 = "0.10.9" siphasher = "1.0.1" -smallvec = { version = "1.15.0", features = ["serde"] } +smallvec = { version = "1.15.1", features = ["serde"] } snafu = "0.8.6" socket2 = "0.5.10" strum = { version = "0.27.1", features = ["derive"] } diff --git a/ecstore/src/cmd/bucket_replication.rs b/ecstore/src/cmd/bucket_replication.rs index 8e1c8a268..0a889d1b1 100644 --- a/ecstore/src/cmd/bucket_replication.rs +++ b/ecstore/src/cmd/bucket_replication.rs @@ -1,7 +1,6 @@ #![allow(unused_variables)] #![allow(dead_code)] // use error::Error; -use crate::StorageAPI; use crate::bucket::metadata_sys::get_replication_config; use crate::bucket::versioning_sys::BucketVersioningSys; use crate::error::Error; @@ -12,25 +11,26 @@ use crate::store_api::ObjectIO; use crate::store_api::ObjectInfo; use crate::store_api::ObjectOptions; use crate::store_api::ObjectToDelete; -use aws_sdk_s3::Client as S3Client; -use aws_sdk_s3::Config; +use crate::StorageAPI; use aws_sdk_s3::config::BehaviorVersion; use aws_sdk_s3::config::Credentials; use aws_sdk_s3::config::Region; +use aws_sdk_s3::Client as S3Client; +use aws_sdk_s3::Config; use bytes::Bytes; use chrono::DateTime; use chrono::Duration; use chrono::Utc; -use futures::StreamExt; use futures::stream::FuturesUnordered; +use futures::StreamExt; use http::HeaderMap; use http::Method; use lazy_static::lazy_static; // use std::time::SystemTime; use once_cell::sync::Lazy; use regex::Regex; -use rustfs_rsc::Minio; use rustfs_rsc::provider::StaticProvider; +use rustfs_rsc::Minio; use s3s::dto::DeleteMarkerReplicationStatus; use s3s::dto::DeleteReplicationStatus; use s3s::dto::ExistingObjectReplicationStatus; @@ -42,14 +42,14 @@ use std::collections::HashMap; use std::collections::HashSet; use std::fmt; use std::iter::Iterator; -use std::sync::Arc; use std::sync::atomic::AtomicI32; use std::sync::atomic::Ordering; +use std::sync::Arc; use std::vec; use time::OffsetDateTime; +use tokio::sync::mpsc::{Receiver, Sender}; use tokio::sync::Mutex; use tokio::sync::RwLock; -use tokio::sync::mpsc::{Receiver, Sender}; use tokio::task; use tracing::{debug, error, info, warn}; use uuid::Uuid; @@ -831,7 +831,8 @@ impl ReplicationPool { fn get_worker_ch(&self, bucket: &str, object: &str, _sz: i64) -> Option<&Sender>> { let h = xxh3_64(format!("{}{}", bucket, object).as_bytes()); // 计算哈希值 - //need lock; + + // need lock; let workers = &self.workers_sender; // 读锁 if workers.is_empty() {