Age | Commit message (Collapse) | Author |
|
Fix for #1847 when dealing with NULL multi bulk replies in RedisCluster.
Adds `Redis::OPT_NULL_MULTIBULK_AS_NULL` setting to have PhpRedis
treat NULL multi bulk replies as `NULL` instead of `[]`.
Co-authored-by: Alex Offshore <offshore@aopdg.ru>
|
|
|
|
Add support for Redis 6 ACLs in the `Redis`, `RedisCluster`, and `RedisArray` classes.
On a related note, it adds a mechanism for users to customize how we generate persistent connection IDs such that they can be grouped in different ways depending on the specific use case required (e.g. it would allow connections to be grouped by username, or by user-defined persistent_id, or both).
|
|
Various improvements and fixes to cluster slot caching.
* Improves slot caching so any unique set of seeds all hash to the same key
* Fix a couple of memory leaks.
* Fixes a segfault when executing a multiple key command such as `MGET` or `MSET` while the cluster is resharding.
|
|
|
|
|
|
|
|
See #1693
|
|
|
|
|
|
|
|
|
|
Adds an option to process the actual strings in simple string replies as
opposed to translating them to `true`. This only applies to
`rawCommand` and `eval` because as far as I know know vanilla Redis
command attaches any information besides `OK` to simple string replies.
Addresses #1550
|
|
RedisCluster currently has a high construction overhead because
every request has to issue a CLUSTER SLOTS command to map the
keyspace. The issue is especially evident when a request only
does a few commands.
|
|
This commit removes support for PHP 5 by getting rid of all of our Zend
compatibility layer methods, as well as any call checking against
PHP_MAJOR_VERSION or ZEND_MODULE_API_NO.
Unit tests are all passing for Redis, RedisCluster, and RedisArray but
this should still be considered a work in progress until more testing
can be done.
Addresses issue #1448
|
|
|
|
* Reset the socket after a timeout to make sure no wrong data is received
* Remove the lazy_connect completely
* Missing TSRMLS_CC
* Remove redundant check if the stream exists
* Add the redis_sock_server_open to the CLUSTER_SEND_PAYLOAD macro
|
|
Streams API
|
|
Persistant connections can be closed via close method.
Connection marked as failed only after reconnection attempts.
|
|
Use `cluster_free` in `free_cluster_context` to free cluster object.
Call `cluster_disconnect` before destroying cluster object.
|
|
Following fields were changed: err, prefix, persistent_id, auth and host
|
|
|
|
|
|
|
|
|
|
In php7 the zend_object handler structure is inlined (is no longer a pointer,
but rather variable sized depending on various things, so it needs to be at the
end of the container class.
This is mentioned in the extensive /s upgrading documentation from Zend
See "custom objects":
https://wiki.php.net/phpng-upgrading
In addition I believe that the zend library now takes care of freeing the overall
structure, so that shouldn't be done anymore if running php >= 7.0.0.
|
|
|
|
Redefine add_next_index_stringl
|
|
RETVAL_STRING and RETVAL_STRINGL always duplicate value
|
|
Rename zend_rsrc_list_entry to zend_resource
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Fixed serialization for various multi-bulk responses
* Properly handle NULL BULK replies for variant replies
|
|
* Updated the unit test suite to print each unit test method name we're
running as we do so, and also with fancy colors :-)
* Added functionality to handle failed transactions, where Redis will send
us a multi bulk length of -1. This can happen because of an EXECABORT
error, or because a watched key was modified during the transaction
* Initialize serialized return value to NULL to avoid segfault
* use strtol not atoi in our long response handler, to handle large values
* Fixed our return value in multi responses
* Fiexed type() command as cluster doesn't still have the '+' prefix when
checking for what TYPE returns
* Exists should return a BOOLEAN not 1/0
* Fixed sRandMember to work in the context of a MULTI block
* Use "LINDEX" not "LGET" as "LGET" isn't a valid Redis command
* Properly set our slot for the PFCOUNT command
* Many unit test changes such that Redis and RedisCluster are happy using
mostly the same ones.
|
|
|
|
|
|
|
|
|
|
We may want to configure phpredis such that it will attempt to fall back
to a given master's slave, if the master were to go down (and the command
is read only).
|
|
When phpredis is communicating with a cluster, there are two
different kinds of timeout events.
The first, is your standard read or write timeout where the socket is
blocked either because of network issues, or because Redis is taking
longer than the timeout to complete the request.
The second is unique to cluster. Because Redis Cluster attempts to
automatically failover (in the case of replicas), phpredis cluster
will attempt to get data from a node where it thinks the key would
live, and upon a failure to connect, try a different node (at random).
This is because Redis could be resharding the connection and may point
the client to a new (now good node). However, if it's not yet detected
a failure, it will just bounce us back to the prior node (which could
be actually down or have just sputtered due to various issues).
So in this case, phpredis uses a second timeout mechanism where we keep
track (in milleseconds) when we entered the query/response loop. Once
we've been unsuccessful up to this timeout, phpredis will abort with
a different (catchable) exception.
TODO: It may be a good idea to implement some small delay, so we don't
hit the cluster with lots of requests over and over until the cluster
comes back.
|
|
|
|
When Redis Cluster responds with a CLUSTERDOWN error, we should
throw an exception. It seems that in the current state of cluster
(during slave election), it will enter a CLUSTERDOWN state for a
short period of time.
This allows clients to trap the exception and then either wait and
try again, or do something else.
|
|
Implemented PING for RedisCluster
|
|
This commit implements the INFO command for RedisCluster, which
behaves like other direct to node commands and can take either
a key or a host and port.
Updated cluster_send_slot function such that on success it sets
the proper reply slot.
|
|
Initial commit of the SCAN command for cluster. As a first iteration,
the command takes a host:port string (which can be retreived from the
introspection method RedisCluster::_masters()), to scan either
everything in the cluster (e.g. in a loop), or one in particular.
A simple way to scan everything in the whole cluster Keyspace
$obj_c->setOption(RedisCluster::OPT_SCAN, RedisCluster::SCAN_RETRY);
foreach($obj_c->_masters() as $str_hash) {
$it = NULL;
while($arr = $obj_c->scan($it, $str_hash)) {
foreach($arr as $key) {
echo "$str_hash -> " . $key . "\n";
}
}
}
|