feat(redis-cluster): implemented single-slot pipeline support and tests#2798
Open
ebubekiryigit wants to merge 1 commit intophpredis:developfrom
Open
feat(redis-cluster): implemented single-slot pipeline support and tests#2798ebubekiryigit wants to merge 1 commit intophpredis:developfrom
ebubekiryigit wants to merge 1 commit intophpredis:developfrom
Conversation
Implement RedisCluster pipeline mode with slot enforcement and queue buffering, add pipeline exec handling, and reset logic for errors/discard. Update stubs, arginfo, and cluster docs. Expand RedisCluster tests to cover pipeline/multi edge cases, cross-slot errors, mode transitions, and invalid operations.
Author
|
This change also addresses the long-standing discussion in: #1910 |
Member
|
Hi thanks for the PR. I'm not opposed to adding the feature by any means. I'll play around with it locally this week. |
Author
|
Hey @michael-grunder, Thanks for the review! Let me know if there’s anything I should clarify or adjust. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add RedisCluster pipeline support restricted to a single hash slot (hash tags respected).
Enforce slot consistency at queue time; cross-slot pipelines throw RedisClusterException.
Handle pipeline exec/cleanup safely and keep MULTI behavior unchanged.
Update stubs/arginfo and cluster documentation.
Add extensive RedisCluster tests covering pipeline, multi, atomic modes, cross-slot errors, invalid operations, and recovery.
Motivation
Currently RedisCluster rejects PIPELINING entirely. Other clients (e.g. redis-py) allow pipelining for same-slot keys. This change brings PhpRedis to parity while preserving Redis Cluster safety guarantees.
Behavior
Testing
Ran tests in a container:
Performance (local cluster)
Measured testClusterPipelineTiming before and after:
Before Pipeline Support
MGET Time: 0.000579667 secondsPipeline GET Time: 0.026290541 secondsAfter Pipeline Support
MGET Time: 0.000635542 secondsPipeline GET Time: 0.000456541 secondsPipeline performance is now in line with expectations and significantly faster.