Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from upstream #32

Merged
merged 25 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2120136
Benchmark CI (#880)
jaymell Jul 14, 2023
29b4702
Enable keep alive on tcp connections via feature (#886)
DoumanAsh Jul 17, 2023
4104b75
CI: Use later version of redis 7 (#896)
jaymell Jul 21, 2023
a65ab6c
Update routing data for commands.
nihohit Jul 12, 2023
9083a74
handle two word commands
nihohit Jul 13, 2023
2827815
Pin `tempfile` dependency (#902)
jaymell Jul 23, 2023
80a4a38
Add basic Sentinel functionality (#836)
felipou Jul 23, 2023
dfacf67
Additional cluster-async benchmarks (#903)
jaymell Jul 24, 2023
a6b4c74
Tests: Wait for all servers (#901)
barshaul Jul 24, 2023
cbe47c6
Release redis 0.23.1 / redis-test 0.2.1 (#907)
jaymell Jul 28, 2023
e4dfc86
Remove tuple casting on command result.
nihohit Jul 31, 2023
ed44bad
log pushing existing replica.
nihohit Jul 31, 2023
e7a733a
Rustls: Remove usage of deprecated method.
nihohit Aug 8, 2023
e5727a1
Fix AsyncConnection usage in sentinel if aio feature is not used. (#923)
brocaar Aug 9, 2023
bd3cef5
add timeouts to tests github action. (#911)
nihohit Aug 10, 2023
fe2a7df
Release redis 0.23.2 / redis-test 0.2.2 (#924)
nihohit Aug 11, 2023
7756b82
Remove redundancy from example (#918)
nilsmartel Aug 13, 2023
c1efef1
Update redis-test version. (#926)
nihohit Aug 13, 2023
88c940b
Remove unused dependencies.
nihohit Aug 1, 2023
f3e7dba
Fix JSON serialization error test.
nihohit Aug 16, 2023
7643f37
async cluster: Group responses by response_policy. (#888)
nihohit Aug 16, 2023
163f5c2
Determine the type of a key (#933)
bruaba Aug 28, 2023
220c6a9
Fix test to run all failovers. (#937)
nihohit Aug 28, 2023
404640b
Sentinel tests: Ensure no ports are used twice. (#915)
nihohit Aug 28, 2023
b32de05
Merge changes from upstream redis-rs.
nihohit Aug 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 55 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ jobs:
build:

runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
redis:
- 6.2.4
- 7.0.0
- 7.0.12
rust:
- stable
- beta
- nightly
- 1.63.0

steps:

- name: Cache redis
id: cache-redis
uses: actions/cache@v3
Expand Down Expand Up @@ -57,15 +59,16 @@ jobs:
run: |
echo "$HOME" >> $GITHUB_PATH

- name: Install latest nightly
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt

- uses: Swatinem/rust-cache@v1
- uses: actions/checkout@v2

- uses: actions/checkout@v3

- name: Run tests
run: make test
Expand Down Expand Up @@ -138,3 +141,52 @@ jobs:
run: cargo doc --no-deps --document-private-items
env:
RUSTDOCFLAGS: -Dwarnings

benchmark:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
env:
redis_ver: 7.0.0
rust_ver: stable
steps:

- name: Cache redis
id: cache-redis
uses: actions/cache@v3
with:
path: |
~/redis-cli
~/redis-server
key: ${{ runner.os }}-${{ env.redis_ver }}-redis

- name: Install redis
if: steps.cache-redis.outputs.cache-hit != 'true'
run: |
sudo apt-get update
wget https://github.com/redis/redis/archive/${{ env.redis_ver }}.tar.gz;
tar -xzvf ${{ env.redis_ver }}.tar.gz;
pushd redis-${{ env.redis_ver }} && BUILD_TLS=yes make && sudo mv src/redis-server src/redis-cli /usr/bin/ && popd;
echo $PATH

- name: set PATH
run: |
echo "$HOME" >> $GITHUB_PATH

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.rust_ver }}
override: true

- uses: Swatinem/rust-cache@v1

- uses: actions/checkout@v3

- name: Benchmark
run: |
cargo install critcmp
cargo bench --all-features -- --measurement-time 15 --save-baseline changes
git fetch
git checkout ${{ github.base_ref }}
cargo bench --all-features -- --measurement-time 15 --save-baseline base
critcmp base changes
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The crate is called `redis` and you can depend on it via cargo:

```ini
[dependencies]
redis = "0.23.0"
redis = "0.23.2"
```

Documentation on the library can be found at
Expand All @@ -32,7 +32,6 @@ Many commands are implemented through the `Commands` trait but manual
command creation is also possible.

```rust
extern crate redis;
use redis::Commands;

fn fetch_an_integer() -> redis::RedisResult<isize> {
Expand Down Expand Up @@ -60,10 +59,10 @@ To enable asynchronous clients, enable the relevant feature in your Cargo.toml,

```
# if you use tokio
redis = { version = "0.23.0", features = ["tokio-comp"] }
redis = { version = "0.23.2", features = ["tokio-comp"] }

# if you use async-std
redis = { version = "0.23.0", features = ["async-std-comp"] }
redis = { version = "0.23.2", features = ["async-std-comp"] }
```

## TLS Support
Expand All @@ -74,25 +73,25 @@ Currently, `native-tls` and `rustls` are supported.
To use `native-tls`:

```
redis = { version = "0.23.0", features = ["tls-native-tls"] }
redis = { version = "0.23.2", features = ["tls-native-tls"] }

# if you use tokio
redis = { version = "0.23.0", features = ["tokio-native-tls-comp"] }
redis = { version = "0.23.2", features = ["tokio-native-tls-comp"] }

# if you use async-std
redis = { version = "0.23.0", features = ["async-std-native-tls-comp"] }
redis = { version = "0.23.2", features = ["async-std-native-tls-comp"] }
```

To use `rustls`:

```
redis = { version = "0.23.0", features = ["tls-rustls"] }
redis = { version = "0.23.2", features = ["tls-rustls"] }

# if you use tokio
redis = { version = "0.23.0", features = ["tokio-rustls-comp"] }
redis = { version = "0.23.2", features = ["tokio-rustls-comp"] }

# if you use async-std
redis = { version = "0.23.0", features = ["async-std-rustls-comp"] }
redis = { version = "0.23.2", features = ["async-std-rustls-comp"] }
```

With `rustls`, you can add the following feature flags on top of other feature flags to enable additional features:
Expand All @@ -112,7 +111,7 @@ let client = redis::Client::open("rediss://127.0.0.1/")?;

Support for Redis Cluster can be enabled by enabling the `cluster` feature in your Cargo.toml:

`redis = { version = "0.23.0", features = [ "cluster"] }`
`redis = { version = "0.23.2", features = [ "cluster"] }`

Then you can simply use the `ClusterClient`, which accepts a list of available nodes. Note
that only one node in the cluster needs to be specified when instantiating the client, though
Expand All @@ -135,7 +134,7 @@ fn fetch_an_integer() -> String {
Async Redis Cluster support can be enabled by enabling the `cluster-async` feature, along
with your preferred async runtime, e.g.:

`redis = { version = "0.23.0", features = [ "cluster-async", "tokio-std-comp" ] }`
`redis = { version = "0.23.2", features = [ "cluster-async", "tokio-std-comp" ] }`

```rust
use redis::cluster::ClusterClient;
Expand All @@ -155,7 +154,7 @@ async fn fetch_an_integer() -> String {

Support for the RedisJSON Module can be enabled by specifying "json" as a feature in your Cargo.toml.

`redis = { version = "0.23.0", features = ["json"] }`
`redis = { version = "0.23.2", features = ["json"] }`

Then you can simply import the `JsonCommands` trait which will add the `json` commands to all Redis Connections (not to be confused with just `Commands` which only adds the default commands)

Expand Down
10 changes: 10 additions & 0 deletions redis-test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="0.2.1"></a>

### 0.2.2 (2023-08-10)

* Track redis 0.23.2 release

### 0.2.1 (2023-07-28)

* Track redis 0.23.1 release

<a name="0.2.0"></a>
### 0.2.0 (2023-04-05)

Expand Down
6 changes: 3 additions & 3 deletions redis-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "redis-test"
version = "0.2.0"
version = "0.2.2"
edition = "2021"
description = "Testing helpers for the `redis` crate"
homepage = "https://github.com/redis-rs/redis-rs"
Expand All @@ -13,7 +13,7 @@ rust-version = "1.63"
bench = false

[dependencies]
redis = { version = "0.23.0", path = "../redis" }
redis = { version = "0.23.2", path = "../redis" }

bytes = { version = "1", optional = true }
futures = { version = "0.3", optional = true }
Expand All @@ -22,5 +22,5 @@ futures = { version = "0.3", optional = true }
aio = ["futures", "redis/aio"]

[dev-dependencies]
redis = { version = "0.23.0", path = "../redis", features = ["aio", "tokio-comp"] }
redis = { version = "0.23.2", path = "../redis", features = ["aio", "tokio-comp"] }
tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread", "time"] }
45 changes: 45 additions & 0 deletions redis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,48 @@
<a name="0.23.1"></a>
### 0.23.2 (2023-08-10)

#### Fixes
* Fix sentinel tests flakiness ([#912](https://github.com/redis-rs/redis-rs/pull/912))
* Rustls: Remove usage of deprecated method ([#921](https://github.com/redis-rs/redis-rs/pull/921))
* Fix compiling with sentinel feature, without aio feature ([#922](https://github.com/redis-rs/redis-rs/pull/923) @brocaar)
* Add timeouts to tests github action ([#911](https://github.com/redis-rs/redis-rs/pull/911))

### 0.23.1 (2023-07-28)

#### Features
* Add basic Sentinel functionality ([#836](https://github.com/redis-rs/redis-rs/pull/836) @felipou)
* Enable keep alive on tcp connections via feature ([#886](https://github.com/redis-rs/redis-rs/pull/886) @DoumanAsh)
* Support fan-out commands in cluster-async ([#843](https://github.com/redis-rs/redis-rs/pull/843) @nihohit)
* connection_manager: retry and backoff on reconnect ([#804](https://github.com/redis-rs/redis-rs/pull/804) @nihohit)

#### Changes
* Tests: Wait for all servers ([#901](https://github.com/redis-rs/redis-rs/pull/901) @barshaul)
* Pin `tempfile` dependency ([#902](https://github.com/redis-rs/redis-rs/pull/902))
* Update routing data for commands. ([#887](https://github.com/redis-rs/redis-rs/pull/887) @nihohit)
* Add basic benchmark reporting to CI ([#880](https://github.com/redis-rs/redis-rs/pull/880))
* Add `set_options` cmd ([#879](https://github.com/redis-rs/redis-rs/pull/879) @RokasVaitkevicius)
* Move random connection creation to when needed. ([#882](https://github.com/redis-rs/redis-rs/pull/882) @nihohit)
* Clean up existing benchmarks ([#881](https://github.com/redis-rs/redis-rs/pull/881))
* Improve async cluster client performance. ([#877](https://github.com/redis-rs/redis-rs/pull/877) @nihohit)
* Allow configuration of cluster retry wait duration ([#859](https://github.com/redis-rs/redis-rs/pull/859) @nihohit)
* Fix async connect when ns resolved to multi ip ([#872](https://github.com/redis-rs/redis-rs/pull/872) @hugefiver)
* Reduce the number of unnecessary clones. ([#874](https://github.com/redis-rs/redis-rs/pull/874) @nihohit)
* Remove connection checking on every request. ([#873](https://github.com/redis-rs/redis-rs/pull/873) @nihohit)
* cluster_async: Wrap internal state with Arc. ([#864](https://github.com/redis-rs/redis-rs/pull/864) @nihohit)
* Fix redirect routing on request with no route. ([#870](https://github.com/redis-rs/redis-rs/pull/870) @nihohit)
* Amend README for macOS users ([#869](https://github.com/redis-rs/redis-rs/pull/869) @sarisssa)
* Improved redirection error handling ([#857](https://github.com/redis-rs/redis-rs/pull/857))
* Fix minor async client bug. ([#862](https://github.com/redis-rs/redis-rs/pull/862) @nihohit)
* Split aio.rs to separate files. ([#821](https://github.com/redis-rs/redis-rs/pull/821) @nihohit)
* Add time feature to tokio dependency ([#855](https://github.com/redis-rs/redis-rs/pull/855) @robjtede)
* Refactor cluster error handling ([#844](https://github.com/redis-rs/redis-rs/pull/844))
* Fix unnecessarily mutable variable ([#849](https://github.com/redis-rs/redis-rs/pull/849) @kamulos)
* Newtype SlotMap ([#845](https://github.com/redis-rs/redis-rs/pull/845))
* Bump MSRV to 1.60 ([#846](https://github.com/redis-rs/redis-rs/pull/846))
* Improve error logging. ([#838](https://github.com/redis-rs/redis-rs/pull/838) @nihohit)
* Improve documentation, add references to `redis-macros` ([#769](https://github.com/redis-rs/redis-rs/pull/769) @daniel7grant)
* Allow creating Cmd with capacity. ([#817](https://github.com/redis-rs/redis-rs/pull/817) @nihohit)

<a name="0.23.0"></a>
### 0.23.0 (2023-04-05)
In addition to *everything mentioned in 0.23.0-beta.1 notes*, this release adds support for Rustls, a long-
Expand Down
16 changes: 12 additions & 4 deletions redis/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "redis"
version = "0.23.0"
version = "0.23.2"
keywords = ["redis", "database"]
description = "Redis driver for Rust."
homepage = "https://github.com/redis-rs/redis-rs"
Expand Down Expand Up @@ -42,6 +42,7 @@ futures-util = { version = "0.3.15", default-features = false, optional = true }
pin-project-lite = { version = "0.2", optional = true }
tokio-util = { version = "0.7", optional = true }
tokio = { version = "1", features = ["rt", "net", "time"], optional = true }
socket2 = { version = "0.4", default-features = false, optional = true }

# Only needed for the connection manager
arc-swap = { version = "1.1.0", optional = true }
Expand Down Expand Up @@ -71,7 +72,7 @@ tokio-native-tls = { version = "0.3", optional = true }
async-native-tls = { version = "0.4", optional = true }

# Only needed for rustls
rustls = { version = "0.21.0", optional = true }
rustls = { version = "0.21.6", optional = true }
webpki-roots = { version = "0.23.0", optional = true }
rustls-native-certs = { version = "0.6.2", optional = true }
tokio-rustls = { version = "0.24.0", optional = true }
Expand All @@ -88,7 +89,7 @@ log = { version = "0.4", optional = true }
futures-time = { version = "3.0.0", optional = true }

[features]
default = ["acl", "streams", "geospatial", "script"]
default = ["acl", "streams", "geospatial", "script", "keep-alive"]
acl = []
aio = ["bytes", "pin-project-lite", "futures-util", "futures-util/alloc", "futures-util/sink", "tokio/io-util", "tokio-util", "tokio-util/codec", "tokio/sync", "combine/tokio", "async-trait", "futures-time"]
geospatial = []
Expand All @@ -108,6 +109,8 @@ tokio-rustls-comp = ["tokio-comp", "tls-rustls", "tokio-rustls"]
connection-manager = ["arc-swap", "futures", "aio", "tokio-retry"]
streams = []
cluster-async = ["cluster", "futures", "futures-util", "log"]
keep-alive = ["socket2"]
sentinel = ["rand"]

# Deprecated features
tls = ["tls-native-tls"] # use "tls-native-tls" instead
Expand All @@ -123,7 +126,7 @@ criterion = "0.4"
partial-io = { version = "0.5", features = ["tokio", "quickcheck1"] }
quickcheck = "1.0.3"
tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread", "time"] }
tempfile = "3.2"
tempfile = "=3.6.0"
once_cell = "1"
anyhow = "1"

Expand Down Expand Up @@ -160,6 +163,11 @@ name = "bench_cluster"
harness = false
required-features = ["cluster"]

[[bench]]
name = "bench_cluster_async"
harness = false
required-features = ["cluster-async", "tokio-comp"]

[[example]]
name = "async-multiplexed"
required-features = ["tokio-comp"]
Expand Down
Loading
Loading