Skip to content

Commit 43b4e70

Browse files
Merge pull request #83 from KarthikSubbarao/1.0
Merge from unstable into 1.0
2 parents 15de25c + 0321aea commit 43b4e70

20 files changed

Lines changed: 208 additions & 57 deletions

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ jobs:
2121
server_version: ['unstable', '8.0', '8.1']
2222
steps:
2323
- uses: actions/checkout@v4
24-
- name: Set the server verison for python integeration tests
24+
- name: Set the server version for python integration tests
2525
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV
2626
- name: Run cargo and clippy format check
2727
run: |
2828
cargo fmt --check
29-
cargo clippy --profile release --all-targets -- -D clippy::all
29+
cargo clippy --profile release --all-targets
3030
- name: Release Build
3131
run: |
3232
if [ "${{ matrix.server_version }}" = "8.0" ]; then
33-
RUSTFLAGS="-D warnings" cargo build --all --all-targets --release --features valkey_8_0
33+
cargo build --all --all-targets --release --features valkey_8_0
3434
else
35-
RUSTFLAGS="-D warnings" cargo build --all --all-targets --release
35+
cargo build --all --all-targets --release
3636
fi
3737
- name: Run unit tests
3838
run: cargo test --features enable-system-alloc
@@ -72,9 +72,9 @@ jobs:
7272
- name: Run cargo and clippy format check
7373
run: |
7474
cargo fmt --check
75-
cargo clippy --profile release --all-targets -- -D clippy::all
75+
cargo clippy --profile release --all-targets
7676
- name: Release Build
77-
run: RUSTFLAGS="-D warnings" cargo build --all --all-targets --release
77+
run: cargo build --all --all-targets --release
7878
- name: Run unit tests
7979
run: cargo test --features enable-system-alloc
8080

@@ -86,18 +86,18 @@ jobs:
8686
server_version: ['unstable', '8.0', '8.1']
8787
steps:
8888
- uses: actions/checkout@v4
89-
- name: Set the server verison for python integeration tests
89+
- name: Set the server version for python integration tests
9090
run: echo "SERVER_VERSION=${{ matrix.server_version }}" >> $GITHUB_ENV
9191
- name: Run cargo and clippy format check
9292
run: |
9393
cargo fmt --check
94-
cargo clippy --profile release --all-targets -- -D clippy::all
94+
cargo clippy --profile release --all-targets
9595
- name: Release Build
9696
run: |
9797
if [ "${{ matrix.server_version }}" = "8.0" ]; then
98-
RUSTFLAGS="-D warnings" cargo build --all --all-targets --release --features valkey_8_0
98+
cargo build --all --all-targets --release --features valkey_8_0
9999
else
100-
RUSTFLAGS="-D warnings" cargo build --all --all-targets --release
100+
cargo build --all --all-targets --release
101101
fi
102102
- name: Run unit tests
103103
run: cargo test --features enable-system-alloc
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Trigger Extension Update - Bloom
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Version of Valkey Bloom module that was released
10+
required: true
11+
12+
jobs:
13+
trigger:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Determine version
17+
id: determine-vars
18+
run: |
19+
if [[ "${{ github.event_name }}" == "release" ]]; then
20+
echo "Triggered by a release event."
21+
VERSION=${{ github.event.release.tag_name }}
22+
else
23+
echo "Triggered by workflow_dispatch."
24+
VERSION=${{ inputs.version }}
25+
fi
26+
27+
echo "version=$VERSION" >> $GITHUB_OUTPUT
28+
29+
- name: Trigger extension update
30+
uses: peter-evans/repository-dispatch@v3
31+
with:
32+
token: ${{ secrets.EXTENSION_PAT }}
33+
repository: ${{ github.repository_owner }}/valkey-bundle
34+
event-type: bloom-release
35+
client-payload: >
36+
{
37+
"version": "${{ steps.determine-vars.outputs.version }}",
38+
"component": "bloom"
39+
}
40+

00-RELEASENOTES

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
1-
Valkey Bloom 1.0.0 release notes
1+
Valkey Bloom 1.0 release notes
22
========================
33

4+
Upgrade urgency levels:
5+
6+
| Level | Meaning |
7+
|----------|---------------------------------------------------------------------|
8+
| LOW | No need to upgrade unless there are new features you want to use. |
9+
| MODERATE | Program an upgrade of the server, but it's not urgent. |
10+
| HIGH | There is a critical bug that may affect a subset of users. Upgrade! |
11+
| CRITICAL | There is a critical bug affecting MOST USERS. Upgrade ASAP. |
12+
| SECURITY | There are security fixes in the release. |
13+
14+
================================================================================
15+
Valkey Bloom 1.0.1 - Released Mon 23 February 2026
16+
================================================================================
17+
18+
Upgrade urgency SECURITY: This release includes security fixes we recommend you
19+
apply as soon as possible.
20+
21+
### Security fixes
22+
23+
* (CVE-2026-21864) - Remote DoS from malformed RESTORE command. Fixed by: KarthikSubbarao - Set ModuleOptions to Handle IO Errors (#82)
24+
425
================================================================================
526
Valkey Bloom 1.0.0 GA - Released Tue 01 April 2025
627
================================================================================

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "valkey-bloom"
33
authors = ["Karthik Subbarao"]
4-
version = "1.0.0"
4+
version = "1.0.1"
55
edition = "2021"
66
license = "BSD-3-Clause"
77
repository = "https://github.com/valkey-io/valkey-bloom"

QUICK_START.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Follow these steps to set up, build, and run the Valkey server with the valkey-b
44

55
## Step 1: Install Valkey and valkey-bloom
66

7-
1. Build Valkey from source by following the instructions [here](https://github.com/valkey-io/valkey?tab=readme-ov-file#building-valkey-using-makefile). Make sure to use Valkey version 8.0 or above.
7+
1. Follow the [instructions to build Valkey from source](https://github.com/valkey-io/valkey?tab=readme-ov-file#building-valkey-using-makefile). Make sure to use Valkey version 8.0 or above.
88

9-
2. Build the valkey-bloom module from source by following the instructions [here](https://github.com/valkey-io/valkey-bloom/blob/unstable/README.md#build-instructions).
9+
2. Follow the [instructions to build the valkey-bloom module from source](https://github.com/valkey-io/valkey-bloom/blob/unstable/README.md#build-instructions).
1010

1111
## Step 2: Run the Valkey Server with valkey-bloom
1212

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# valkey-bloom
22

3-
Valkey-Bloom (BSD-3-Clause) is a Rust based Valkey-Module which brings a Bloom Filter (Module) data type into Valkey and supports verions >= 8.0. With this, users can create bloom filters (space efficient probabilistic data structures) to add elements, check whether elements exists, auto scale their filters, customize bloom filter properties, perform RDB Save and load operations, etc.
3+
Valkey-Bloom (BSD-3-Clause) is a Rust based Valkey-Module which brings a Bloom Filter (Module) data type into Valkey and supports versions >= 8.0. With this, users can create bloom filters (space efficient probabilistic data structures) to add elements, check whether elements exists, auto scale their filters, customize bloom filter properties, perform RDB Save and load operations, etc.
44

55
Valkey-Bloom is built using `bloomfilter::Bloom` (https://crates.io/crates/bloomfilter which has a BSD-2-Clause license).
66

@@ -37,12 +37,14 @@ valkey-server --loadmodule ./target/release/libvalkey_bloom.so
3737
# Builds the valkey-server (unstable) for integration testing.
3838
SERVER_VERSION=unstable
3939
./build.sh
40-
# Same as above, but uses valkey-server (8.0.0) for integration testing.
41-
SERVER_VERSION=8.0.0
40+
# Same as above, but uses valkey-server (8.0) for integration testing.
41+
SERVER_VERSION=8.0
4242
./build.sh
4343
# Build with asan, you may need to remove the old valkey binary if you have used ./build.sh before. You can do this by deleting the `.build` folder in the `tests` folder
4444
ASAN_BUILD=true
4545
./build.sh
46+
# Clean build artifacts
47+
./build.sh clean
4648
```
4749

4850
## Load the Module
@@ -74,4 +76,4 @@ valkey-server --loadmodule /path/to/libvalkey_bloom.so
7476
cargo build --release --features valkey_8_0
7577
```
7678

77-
This can also be done by specifiyng SERVER_VERSION=8.0.0 and then running `./build.sh`
79+
This can also be done by specifying SERVER_VERSION=8.0 and then running `./build.sh`

build.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ set -e
88
SCRIPT_DIR=$(pwd)
99
echo "Script Directory: $SCRIPT_DIR"
1010

11+
if [ "$1" = "clean" ]; then
12+
echo "Cleaning build artifacts"
13+
rm -rf target/
14+
rm -rf tests/build/
15+
rm -rf test-data/
16+
echo "Clean completed."
17+
exit 0
18+
fi
19+
1120
echo "Running cargo and clippy format checks..."
1221
cargo fmt --check
1322
cargo clippy --profile release --all-targets -- -D clippy::all
@@ -22,7 +31,7 @@ if [ -z "$SERVER_VERSION" ]; then
2231
export SERVER_VERSION="unstable"
2332
fi
2433

25-
if [ "$SERVER_VERSION" != "unstable" ] && [ "$SERVER_VERSION" != "8.0" ] && [ "$SERVER_VERSION" != "8.1" ]; then
34+
if [ "$SERVER_VERSION" != "unstable" ] && [ "$SERVER_VERSION" != "8.0" ] && [ "$SERVER_VERSION" != "8.1" ] && [ "$SERVER_VERSION" != "9.0" ]; then
2635
echo "ERROR: Unsupported version - $SERVER_VERSION"
2736
exit 1
2837
fi
@@ -90,9 +99,9 @@ fi
9099

91100
os_type=$(uname)
92101
MODULE_EXT=".so"
93-
if [[ "$os_type" == "Darwin" ]]; then
102+
if [ "$os_type" = "Darwin" ]; then
94103
MODULE_EXT=".dylib"
95-
elif [[ "$os_type" == "Linux" ]]; then
104+
elif [ "$os_type" = "Linux" ]; then
96105
MODULE_EXT=".so"
97106
else
98107
echo "Unsupported OS type: $os_type"
@@ -103,7 +112,7 @@ export MODULE_PATH="$SCRIPT_DIR/target/release/libvalkey_bloom$MODULE_EXT"
103112
echo "Running the integration tests..."
104113
if [ ! -z "${ASAN_BUILD}" ]; then
105114
# TEST_PATTERN can be used to run specific tests or test patterns.
106-
if [[ -n "$TEST_PATTERN" ]]; then
115+
if [ -n "$TEST_PATTERN" ]; then
107116
python3 -m pytest --capture=sys --cache-clear -v "$SCRIPT_DIR/tests/" -k $TEST_PATTERN 2>&1 | tee test_output.tmp
108117
else
109118
echo "TEST_PATTERN is not set. Running all integration tests."
@@ -132,7 +141,7 @@ if [ ! -z "${ASAN_BUILD}" ]; then
132141
rm test_output.tmp
133142
else
134143
# TEST_PATTERN can be used to run specific tests or test patterns.
135-
if [[ -n "$TEST_PATTERN" ]]; then
144+
if [ -n "$TEST_PATTERN" ]; then
136145
python3 -m pytest --cache-clear -v "$SCRIPT_DIR/tests/" -k $TEST_PATTERN
137146
else
138147
echo "TEST_PATTERN is not set. Running all integration tests."

src/bloom/data_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl ValkeyDataType for BloomObject {
5757
/// Callback to load and parse RDB data of a bloom item and create it.
5858
fn load_from_rdb(rdb: *mut raw::RedisModuleIO, encver: i32) -> Option<BloomObject> {
5959
if encver > BLOOM_TYPE_ENCODING_VERSION {
60-
logging::log_warning(format!("{}: Cannot load bloomfltr data type of version {} because it is higher than the loaded module's bloomfltr supported version {}", MODULE_NAME, encver, BLOOM_TYPE_ENCODING_VERSION).as_str());
60+
logging::log_warning(format!("{}: Cannot load bloomfltr data type of version {} because it is greater than the loaded module's bloomfltr supported version {}", MODULE_NAME, encver, BLOOM_TYPE_ENCODING_VERSION).as_str());
6161
return None;
6262
}
6363
let Ok(num_filters) = raw::load_unsigned(rdb) else {

src/bloom/utils.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl BloomObject {
193193
+ (filters_vec_capacity * std::mem::size_of::<Box<BloomFilter>>())
194194
}
195195

196-
/// Caculates the number of bytes that the bloom object will require to be allocated.
196+
/// Calculates the number of bytes that the bloom object will require to be allocated.
197197
/// This is used when scaling out a bloom object to check if the new
198198
/// size will be within the allowed size limit.
199199
/// Returns whether the bloom object is of a valid size or not.
@@ -202,7 +202,7 @@ impl BloomObject {
202202
BloomObject::validate_size(bytes)
203203
}
204204

205-
/// Caculates the number of bytes that the bloom object will require to be allocated.
205+
/// Calculates the number of bytes that the bloom object will require to be allocated.
206206
/// This is used when creating a new bloom object to check if the size is within the allowed size limit.
207207
/// Returns whether the bloom object is of a valid size or not.
208208
fn validate_size_before_create(capacity: i64, fp_rate: f64) -> bool {
@@ -273,7 +273,7 @@ impl BloomObject {
273273
self.expansion
274274
}
275275

276-
/// Return the false postive rate of the bloom object.
276+
/// Return the false positive rate of the bloom object.
277277
pub fn fp_rate(&self) -> f64 {
278278
self.fp_rate
279279
}
@@ -490,7 +490,7 @@ impl BloomObject {
490490
/// * `validate_scale_to` - the capacity we check to see if it can scale to. If this method is called from BF.INFO this is set as -1 as we
491491
/// want to check the maximum size we could scale up till
492492
/// * `tightening_ratio` - The tightening ratio of the object
493-
/// * `expansion` - The expanison rate of the object
493+
/// * `expansion` - The expansion rate of the object
494494
///
495495
/// # Returns
496496
/// * i64 - The maximum capacity that can be reached if called from BF.INFO. If called from BF.INSERT the size it reached when it became greater than `validate_scale_to`
@@ -645,12 +645,12 @@ impl BloomFilter {
645645
self.bloom.seed()
646646
}
647647

648-
/// Return the numer of items in the BloomFilter.
648+
/// Return the number of items in the BloomFilter.
649649
pub fn num_items(&self) -> i64 {
650650
self.num_items
651651
}
652652

653-
/// Return the capcity of the BloomFilter - number of items that can be added to it.
653+
/// Return the capacity of the BloomFilter - number of items that can be added to it.
654654
pub fn capacity(&self) -> i64 {
655655
self.capacity
656656
}
@@ -761,7 +761,7 @@ mod tests {
761761
Ok(1) => {
762762
if let Some(err) = expected_error {
763763
panic!(
764-
"Expected error on the bloom object during during item add: {:?}",
764+
"Expected error on the bloom object during item add: {:?}",
765765
err
766766
);
767767
}
@@ -1253,7 +1253,7 @@ mod tests {
12531253

12541254
#[test]
12551255
fn test_vec_capacity_matches_size_calculations() {
1256-
// This unit test is designed to make sure out calculations with capcity will always match the correct vec capacity
1256+
// This unit test is designed to make sure out calculations with capacity will always match the correct vec capacity
12571257
let mut test_v = vec![0];
12581258
for i in 0..5000 {
12591259
let x = if i == 0 {

src/commands/bf.info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
{
5050
"name": "tightening",
5151
"type": "pure-token",
52-
"token": "TIGHTENTING"
52+
"token": "TIGHTENING"
5353
},
5454
{
5555
"name": "maxscaledcapacity",

0 commit comments

Comments
 (0)