From 084c5ca0e4f8291ab67afbfe8b9df02747838c86 Mon Sep 17 00:00:00 2001 From: lucasliang Date: Tue, 23 Apr 2024 11:16:07 +0800 Subject: [PATCH] *: bump 0.4.2 (#357) * *: bump 0.4.2 Signed-off-by: lucasliang * Bugfix. Signed-off-by: lucasliang * Update toolchain. Signed-off-by: lucasliang * Correct version Signed-off-by: lucasliang * Fix clippy errors. Signed-off-by: lucasliang * Fix test compilation errs. Signed-off-by: lucasliang * Polish changelog and upload codecov report with TOKEN. Signed-off-by: lucasliang * Fix MacOS compilation errs. Signed-off-by: lucasliang * Revert "Fix MacOS compilation errs." This reverts commit 52773890c88825a5cf198575255e894904ba482b. Signed-off-by: lucasliang * Optimize the ci workflow. Signed-off-by: lucasliang * Downgrade the version to meet the space usage limit of CI. Signed-off-by: lucasliang --------- Signed-off-by: lucasliang --- .github/workflows/rust.yml | 14 +++++++++----- CHANGELOG.md | 7 +++++++ Cargo.toml | 4 ++-- ctl/Cargo.toml | 6 +++--- src/env/log_fd/unix.rs | 4 ++-- src/file_pipe_log/pipe.rs | 2 +- src/swappy_allocator.rs | 1 + stress/Cargo.toml | 2 +- 8 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f6d967c6..a6d2ee09 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,7 +19,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2023-07-01 + toolchain: nightly-2023-12-31 override: true components: rustfmt, clippy, rust-src - uses: Swatinem/rust-cache@v1 @@ -34,6 +34,8 @@ jobs: git diff --exit-code - name: Clippy run: make clippy + env: + EXTRA_CARGO_ARGS: '--fix' - name: Run tests run: make test env: @@ -60,7 +62,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.67.1 + toolchain: 1.75.0 override: true components: rustfmt, clippy, rust-src - uses: Swatinem/rust-cache@v1 @@ -87,7 +89,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly-2023-07-01 + toolchain: nightly-2023-12-31 override: true components: llvm-tools-preview - uses: Swatinem/rust-cache@v1 @@ -99,12 +101,14 @@ jobs: run: | make test_matrix env: - RUSTFLAGS: '-Zinstrument-coverage' + RUSTFLAGS: '-Cinstrument-coverage' LLVM_PROFILE_FILE: '%p-%m.profraw' EXTRA_CARGO_ARGS: '--verbose' - name: Run grcov run: grcov `find . \( -name "*.profraw" \) -print` --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../**' --ignore '/*' -o coverage.lcov - name: Upload - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: file: coverage.lcov diff --git a/CHANGELOG.md b/CHANGELOG.md index e2aaa484..7531efab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ ## [Unreleased] +## [0.4.2] - 2024-04-16 + +### Behavior Changes + +* Periodically flush unsynced bytes when rewriting to avoid I/O jitters if flushing too many bytes impede the foreground writes. (#347) +* Errors will be returned if rewriting fails, instread of `panic` directly. (#343) + ## [0.4.1] - 2023-09-14 ### Behavior Changes diff --git a/Cargo.toml b/Cargo.toml index 4f6f4846..6694e705 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "raft-engine" -version = "0.4.1" +version = "0.4.2" authors = ["The TiKV Project Developers"] edition = "2018" -rust-version = "1.66.0" +rust-version = "1.75.0" description = "A persistent storage engine for Multi-Raft logs" readme = "README.md" repository = "https://github.com/tikv/raft-engine" diff --git a/ctl/Cargo.toml b/ctl/Cargo.toml index 5bf23c8b..4c97eefb 100644 --- a/ctl/Cargo.toml +++ b/ctl/Cargo.toml @@ -1,9 +1,9 @@ [package] name = "raft-engine-ctl" -version = "0.4.1" +version = "0.4.2" authors = ["The TiKV Project Developers"] edition = "2018" -rust-version = "1.61.0" +rust-version = "1.75.0" description = "A control tool for Raft Engine" repository = "https://github.com/tikv/raft-engine" license = "Apache-2.0" @@ -11,4 +11,4 @@ license = "Apache-2.0" [dependencies] clap = { version = "3.1", features = ["derive", "cargo"] } env_logger = "0.10" -raft-engine = { path = "..", version = "0.4.1", features = ["scripting", "internals"] } +raft-engine = { path = "..", version = "0.4.2", features = ["scripting", "internals"] } diff --git a/src/env/log_fd/unix.rs b/src/env/log_fd/unix.rs index 608cca70..e9b75542 100644 --- a/src/env/log_fd/unix.rs +++ b/src/env/log_fd/unix.rs @@ -83,7 +83,7 @@ impl LogFd { while readed < buf.len() { let bytes = match pread(self.0, &mut buf[readed..], offset as i64) { Ok(bytes) => bytes, - Err(e) if e == Errno::EINTR => continue, + Err(Errno::EINTR) => continue, Err(e) => return Err(from_nix_error(e, "pread")), }; // EOF @@ -106,7 +106,7 @@ impl LogFd { while written < content.len() { let bytes = match pwrite(self.0, &content[written..], offset as i64) { Ok(bytes) => bytes, - Err(e) if e == Errno::EINTR => continue, + Err(Errno::EINTR) => continue, Err(e) if e == Errno::ENOSPC => return Err(from_nix_error(e, "nospace")), Err(e) => return Err(from_nix_error(e, "pwrite")), }; diff --git a/src/file_pipe_log/pipe.rs b/src/file_pipe_log/pipe.rs index 43b3483a..27ea8267 100644 --- a/src/file_pipe_log/pipe.rs +++ b/src/file_pipe_log/pipe.rs @@ -713,7 +713,7 @@ mod tests { // Retire files. assert_eq!(pipe_log.purge_to(last).unwrap() as u64, last - first); // Try to read recycled file. - for (_, handle) in handles.into_iter().enumerate() { + for handle in handles.into_iter() { assert!(pipe_log.read_bytes(handle).is_err()); } // Try to reuse. diff --git a/src/swappy_allocator.rs b/src/swappy_allocator.rs index 8baa4835..0cb8db9b 100644 --- a/src/swappy_allocator.rs +++ b/src/swappy_allocator.rs @@ -288,6 +288,7 @@ impl Page { .read(true) .write(true) .create(true) + .truncate(true) .open(path) .map_err(|e| error!("Failed to open swap file: {e}")) .ok()?; diff --git a/stress/Cargo.toml b/stress/Cargo.toml index 79d131e2..e5a24f02 100644 --- a/stress/Cargo.toml +++ b/stress/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stress" -version = "0.4.1" +version = "0.4.2" authors = ["The TiKV Authors"] edition = "2018"