Age | Commit message (Collapse) | Author |
|
Implemented SUBSCRIBE and PSUBSCRIBE for Redis Cluster. Currently
Cluster will send publish messages to every node, so we can subscribe
wherever we like.
|
|
Added the UNWATCH command which will deliver this command only to
nodes that we think we're watching.
|
|
Implemented the WATCH command for RedisCluster. This command can
take any number of keys, so phpredis splits the request across the
cluster in the best way it can.
For every key in a multiple key command, Redis Cluster requires
that they all hash to the same SLOT, else it will return a
CROSSLOT error and fail.
For WATCH in RedisCluster, a few things to note:
* The command will fail if phpredis is out of sync with the keyspace.
This is because we'll need to know where to deliver each command,
or can't possibly deliver them correctlhy.
* The command will fail if any command delivery failures occur on any
node. This is the case either for a normal communication error or
if RedisCluster returns to us MOVED/ASK redirection.
|
|
Implemented our DISCARD command for RedisCluster
Added a mechanism where we can free any context we have (which is
currently always a zval** array for HMGET arguments), even if we
manually DISCARD the transaction OR if the transactino were to
actually fail.
|
|
Fixed HMGET so we don't leak memory when getting members
that don't exist.
Added a call to CLUSTER_RESET_MULTI() at the end of our
EXEC function, so afterwards we're not in MULTI mode.
|
|
This is the initial commit supporting transactions in RedisCluster
via MULTI..EXEC. Given that the data can be distributed across
many nodes, we accomplish transactions as follows.
1. When entering MULTI mode, the cluster context state is changed
to MULTI
2. When we send a command to a node, we check that node's RedisSock
state, and if it's still ATOMIC, deliver the MULTI command,
updating the node's state to MULTI.
3. When reading replies, we check if the RedisSock* is in a MULTI
state, which means we need to issue the EXEC command. We do
this and then flip the state back to ATOMIC.
4. On completion, everything is reverted to ATOMIC state and our
reply callbacks are freed and set to NULL.
For transactions, we enforce writes such that they MUST be able to
be processed by the node in question (e.g. they can't work during
a reshard, because there is no way to know what has failed, etc).
This is the same as RedisCluster which will also cancel transactions
in the case where a request was made for data that is somewhere else.
|
|
Implemented various introspection/option commands for both Redis
and RedisCluster.
Commands implemented:
* getOption
* setOption
* _prefix
* _serialize
* _unserialize
With these implemented, we can properly test RedisCluster with things
like serialization and prefixing turned on.
|
|
Implemented the various set aggregation functions and store
variations for both Redis and RedisCluster in a generic way.
* SUNION
* SUNIONSTORE
* SINTER
* SINTERSTORE
* SDIFF
* SDIFFSTORE
|
|
Properly free allocated z_args array, as well as increment
our argc value in the case of a single array + timeout command.
|
|
Implemented the OBJECT command for both Redis and Redis Cluster
|
|
Implemented ZADD command for both Redis and RedisCluster
|
|
Implemented HDEL command for both Redis and RedisCluster objects
|
|
Added ZREM for both cluster and redis proper
|
|
Implemented SADD and SREM for both Redis proper and cluster
|
|
Added a generic command routine where we take a key and then a
variable number of arguments. This works for stuff like LPUSH,
RPUSH, SADD, SREM, and the like...
Implemented LPUSH/RPUSH
|
|
Implemented ZUNIONSTORE and ZINTERSTORE in a generic way that
works for both cluster and Redis proper.
|
|
Implemented ZRANGEBYSCORE and ZREVRANGEBYSCORE in the new way for
both Redis and RedisCluster objects. In addition, ZRANGE and
ZREVRANGE handling is nearly identical to "BYSCORE" variants, so
made this generic.
|
|
Implemented SORT command in a new way (using a zval array to construct
each argument, then creating the command from that), as well as updated
Redis proper and RedisCluster to use it.
|
|
Implemented ZINCRBY command
|
|
Implemented SRANDMEMBER command for Redis and RedisCluster
|
|
Implemented HSET and HSETNX commands
|
|
Implemented ZRANGE and ZREVRANGE for both Redis and cluster.
We can't use generic command processing here as the return type
depends on the optional WITHSCORES bit.
In addition, switched the code around such that zReverseRange is
an alias of zRevRange because ZREVRANGE is the actual Redis
command name.
|
|
Implemented SMOVE command
|
|
Implemented LREM command
|
|
Implemented LINSERT command
|
|
Implemented SETBIT command
|
|
Implemented SETRANGE and RESTORE commands, which both take the
prototype key, long, string
|
|
Fixed a compile bug where we were invoking the empty command
RANDOMKEY improperly.
Added PFMERGE and PFCOUNT to redis and RedisCluster objects
|
|
Changed RANDOMKEY to use our empty command semantics,
as well as implemented PFCOUNT for both Redis and Cluster
|
|
Commit the rest of our "empty" commands semantics
Implemented BITOP/BITPOS/BITCOUNT commands for both Redis and
RedisCluster
|
|
Added context void pointer that we pass around, which is
(thus far) really just for hmget (as we need to keep the
keys around to bind them with the returned values).
This requires every command construction routine and each
response callback be passed this void pointer, which is always
NULL except for HMGET
Added HMGET and HMSET commands
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For now we're pre-processing each key to determine if they all live
in the same place. This might change for commands that could take
very large numbers of keys
|
|
* Make key, long val generic
* Update lset to use new style
* Added PUBLISH commnad
|
|
|
|
Also removed deprecated generic functions in Redis proper
|
|
|
|
|
|
|
|
Removed redis_atomic_increment, and generic_expire_command
Added EXPIRE/EXPIREAT/PEXPIRE/PEXPIREAT
|
|
We were using RETURN_TRUE instead of RETURN_LONG in
cluster_long_resp, which was wrong.
Added/tested INCR/DECR/INCRBY/DECRBY/INCRBYFLOAT
|
|
Added zipstr handler for k,v,k2,kv to k=>v,k2=>v2 as well as
implemented int based incr and decr commands.
|
|
|
|
|
|
|