From 5b78ec3d8385fba91ea287d4f3d5f38eef00d281 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Wed, 16 Feb 2022 18:17:48 +0100 Subject: [PATCH 1/2] chore: rework features --- Cargo.toml | 20 ++++++++++++++++++-- README.md | 16 +++++++++------- fuzz/Cargo.toml | 2 +- src/lib.rs | 8 ++++---- src/messenger.rs | 2 +- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 47c853d5..04718fd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,16 +53,32 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] } uuid = { version = "0.8", features = ["v4"] } [features] -default = ["transport-tls"] +default = [ + "compression-gzip", + "compression-lz4", + "compression-snappy", + "compression-zstd", +] + +full = [ + "compression-gzip", + "compression-lz4", + "compression-snappy", + "compression-zstd", + "transport-socks5", + "transport-tls", +] compression-gzip = ["flate2"] compression-lz4 = ["lz4"] compression-snappy = ["snap"] compression-zstd = ["zstd"] -fuzzing = [] + transport-socks5 = ["async-socks5"] transport-tls = ["rustls", "tokio-rustls"] +unstable-fuzzing = [] + [[bench]] name = "write_throughput" harness = false diff --git a/README.md b/README.md index 3ffe3dfc..d1ddc6db 100644 --- a/README.md +++ b/README.md @@ -90,14 +90,16 @@ For more advanced production and consumption, see [`crate::client::producer`] an ## Features -- **`compression-gzip`:** Support compression and decompression of messages using [gzip]. -- **`compression-lz4`:** Support compression and decompression of messages using [LZ4]. -- **`compression-snappy`:** Support compression and decompression of messages using [Snappy]. -- **`compression-zstd`:** Support compression and decompression of messages using [zstd]. -- **`fuzzing`:** Exposes some internal data structures so that they can be used by our fuzzers. This is NOT a stable - feature / API! +- **`compression-gzip` (default):** Support compression and decompression of messages using [gzip]. +- **`compression-lz4` (default):** Support compression and decompression of messages using [LZ4]. +- **`compression-snappy` (default):** Support compression and decompression of messages using [Snappy]. +- **`compression-zstd` (default):** Support compression and decompression of messages using [zstd]. +- **`full`:** Includes all stable features (`compression-gzip`, `compression-lz4`, `compression-snappy`, + `compression-zstd`, `transport-socks5`, `transport-tls`). - **`transport-socks5`:** Allow transport via SOCKS5 proxy. -- **`transport-tls` (default):** Allows TLS transport via [rustls]. +- **`transport-tls`:** Allows TLS transport via [rustls]. +- **`unstable-fuzzing`:** Exposes some internal data structures so that they can be used by our fuzzers. This is NOT a stable + feature / API! ## Testing diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 7dd09b08..ad3b1f5b 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -11,7 +11,7 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4.0" pin-project-lite = "0.2" -rskafka = { path = "..", features = ["fuzzing"] } +rskafka = { path = "..", features = ["unstable-fuzzing"] } tokio = { version = "1.14", default-features = false, features = ["io-util", "rt"] } [[bin]] diff --git a/src/lib.rs b/src/lib.rs index 719ce1b1..b631f38e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,14 +22,14 @@ mod backoff; pub mod client; mod connection; -#[cfg(feature = "fuzzing")] +#[cfg(feature = "unstable-fuzzing")] pub mod messenger; -#[cfg(not(feature = "fuzzing"))] +#[cfg(not(feature = "unstable-fuzzing"))] mod messenger; -#[cfg(feature = "fuzzing")] +#[cfg(feature = "unstable-fuzzing")] pub mod protocol; -#[cfg(not(feature = "fuzzing"))] +#[cfg(not(feature = "unstable-fuzzing"))] mod protocol; pub mod record; diff --git a/src/messenger.rs b/src/messenger.rs index 27f158c9..fc180d25 100644 --- a/src/messenger.rs +++ b/src/messenger.rs @@ -258,7 +258,7 @@ where } } - #[cfg(feature = "fuzzing")] + #[cfg(feature = "unstable-fuzzing")] pub fn override_version_ranges(&self, ranges: HashMap) { self.set_version_ranges(ranges); } From 88f8365e2644356a7a2c4fef5971ea7189bc6aca Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Wed, 16 Feb 2022 18:34:55 +0100 Subject: [PATCH 2/2] chore: change log for version 0.2.0 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8242ff9c..62fc890a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,31 @@ # Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## 0.2.0 -- Essential Bug Fixes, Compression + +### Breaking Changes +- `Record::{key,value}` are now optional, following the underlying Kafka protocol (#93) +- compression support, `PartitionClient::produce` requires `compression` parameter (#82, #91, #92, #94) +- `PartitionClient::get_high_watermark` was replaced by `PartitionClient::get_offset` (#100) +- `StreamConsumer::new` `start_offset` parameter changed from `i64` to `StartOffset` type (#104) +- rework features (#107) + +### Features +- record deletion (#97) + +### Bug Fixes +- ignore `InvalidReplicationFactor` (#106) +- fix rare panic in `BatchProducer` (#105) +- filter out records that were not requested (#99) +- terminate consumer stream on `OffsetOutOfRange` (#96) + +### Performance +- faster CRC calculation (#85) + ## 0.1.0 -- Initial Release This is the first release featuring: