Comments (3)
By default, pipelines executes sequentially. When a pipeline executes it will still use a pipeline object for each node in the cluster. If you want to run the pipeline in concurrent mode you can use the flag pipeline_use_threads=True
to use a experimental feature to run each pipeline for each node with threads. From what i know it works really well.
Transactions is a hard problem to solve because there is several ways of defining a transaction and implementing support for both solutions is very hard because there is several corner cases that needs to be handled for the implementation to work. In short the 2 main options is to have a transaction pipeline across the entire cluster, or that the commands that is sent to each node should be transaction but they are not dependent on each other. So if one of 4 would fail the other 3 would still execute and be commited to redis. Currently i have documented and suggested that transactions is not supported right now and should not be used.
You should really read up on the docs, specially this one https://github.com/Grokzen/redis-py-cluster/blob/unstable/docs/Pipelines.md that describes the problems and my thoughts on the problem and possible solutions.
Regarding MGET
in pipelines, it is currently disabled because because if you run MGET keyA keyB keyC keyD
and 2 of the keys belongs to 1 node in the cluster and 2 keys belong to another node, i can't just split the command into MGET keyA keyC
and MGET keyB keyD
and send them off to their nodes and then handle any errors, moved, asking errors that pops up and retry until it either works or fails.
The only somewhat viable solution to this problem would be to take the MGET
command and replace that command with a series of GET
commands that each fetches the all keys and after execution is done, reassembles the original MGET to make it appear to work. In theory you can already do this yourself manually by having a helper function that you call when you want to run MGET
that splits it into multiple GET
and puts them on the pipeline stack, but it is not something that will be supported for now.
from redis-py-cluster.
If that answers your questions, please close this issue. If you find some issue when trying something out, please open a new issue with a description of the problem. Also if you want to discuss this more, please join in the gitter chatroom (link in Readme) and ping me there.
from redis-py-cluster.
hi @Grokzen #92 , this is my issue,by your answer , when I set pipeline_use_threads=True, all the commands queued on pipe will be sent to their coresponding node in the cluster respectively ? And pipe.executes() will returns only after all the responses arrived ? This is the way I supposed the pipe's behavior to be
my gitter quesion , just for record .
from redis-py-cluster.
Related Issues (20)
- archive repo since redis-py is cluster compatible HOT 6
- Redis Cluster cannot be connected. Please provide at least one reachable node. when connecting to cluster HOT 2
- Support of Redis v4.1 HOT 1
- get wrong return value "OK" from redis HOT 1
- how to use ACL in redis cluster client HOT 1
- TypeError: unsupported operand type(s) for +: 'int' and 'str' HOT 1
- version 2.1.3 raise rediscluster.exceptions.MovedError when connect redis cluster HOT 4
- Is need to connection pool disconect? HOT 2
- ClusterWithReadReplicasConnectionPool with read_from_replicas causes dump. HOT 1
- KeyError:636 -> BaseException HOT 2
- Support for PSYNC HOT 1
- rediscluster.exceptions.ClusterError: TTL exhausted HOT 4
- The first node of cluster can not connect HOT 2
- Is there any params for RedisCluster __init__, to let redis know when did idle client connection should be kicked out HOT 3
- ImportError: cannot import name 'SlotNotCoveredError' from 'rediscluster.exceptions' HOT 1
- Turn off vervose logging HOT 4
- Best practice for deletion from Redis HOT 2
- Please update so that it can be installed on Python 3.11 HOT 2
- use redis-py-cluster unable to connect to redis cluster in python 2.7 HOT 2
- is ClusterBlockingConnectionPool work in gevent? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis-py-cluster.