Use \Redis::PIPELINE for ->multi() in PhpRedis instead of true transactions

Created on 6 June 2025, 2 months ago

Problem/Motivation

We have gotten redis with PhpRedis extension to work with RedisCluster using Envoy proxy.

However it is not possible to use transactions with Envoy proxy as several keys can span several servers.

So while envoy has a mechanism to retry a key on another redis cluster node this won't work when using transactions instead of \Redis::PIPELINE.

Steps to reproduce

- Redis Cluster with 3 nodes
- Envoy Proxy
- Current redis module

Proposed resolution

I looked historically and it is unclear if ->multi() truly was wanted for transaction support. (e.g. in a get multiple statement) or if things should be pipeline()'d. Due to Predis using pipeline() instead of transaction it seems possible that PhpRedis ->multi() support using transactions was simply a misunderstanding.

After AI analysis most occurrences should be \Redis::PIPELINE instead to save on network traffic, but the atomicity of the transaction is not needed.

Therefore the current patch does add \Redis::PIPELINE to the ->multi() argument.

Remaining tasks

- Ensure all things changed are truly pipeline() (same as with Predis)

User interface changes

- None

API changes

- None

Data model changes

- None

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Fabianx

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024