* Added support for transactions in OSS Cluster
* Updated test cases
* Updated version restriction
* Updated server version restriction
* Added test skip for Relay
* Added test case for Relay
* Set transaction slot to null in case of failed transaction
* Restrict usage of transaction commands outside of transaction context
* Added handling for Relay responses
* Reverted changes
* Removed unsupported command
* Added dummy arguments
* Codestyle fixes
* Added additional test coverage
* Added CHANGELOG and README entries
* Added missing PR reference
* Missing word
* Fixed README
* Added support for redis gears trigger function commands
* Exclude gears tests from relay connection tests
* Codestyle fixes
* Added missing test coverage
* Updated method description
* Use redis-stack:edge image istead of separate container
* Updated RESP3 modules responses
* Removed redundant constants
* Added additional timeout to make sure that index was created
* Marked test as relay-incompatible
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Increase timeout after index creation
* Added support for trigger functions command run against OSS cluster
* Mark gears cluster tests with appropriate annotation
* Marked with cluster annotation
* Codestyle fixes
* Removed refresh cluster on connection, moved to refresh manually in tests
* Removed redundant test
* Updated README, added comments with README references
* Revert "Marked test as relay-incompatible"
This reverts commit d888968b7b.
* Revert changes
* Revert "Mark tests as relay-incompatible"
This reverts commit 7d34370c6b.
* Revert "Updated RESP3 modules responses"
This reverts commit 5cf122ad71.
* Removed latest image
* Updated RESP3 modules responses (#4)
* Marked tests as relay-incompatible (#3)
* Marked test as relay-incompatible
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Changed tests group for RESP3 not supported tests
* Fixed broken tests
* Removed redundant test
* Marked test as relay-incompatible
* Codestyle fixes
* Updated CHANGELOG.md
* Updated CHANGELOG.md
* Revert php-cs-fixer style changes
---------
Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Changed command arguments (#1330)
* Re-implement CLIENT command as container command (#1337)
* Resolve merge conflicts
* Merge 2.x into main (#1341)
* Codestyle changes related to php-cs-fixer update (#1311)
* Codestyle changes
* Added missing type-hints
* Added GETDEL command to KeyPrefixProcessor (#1306)
* Added GETDEL command to KeyPrefixProcessor
* Added test coverage
* Codestyle fixes
* Added timeout after FT.CREATE call
* Added support for JSON.MERGE command (#1304)
* Added support for JSON.MSET command (#1307)
* Fixed subcommand test bug (#1313)
* Update CHANGELOG.md
* Update CHANGELOG.md
* Fixed bug with incorrect multiple words processing (#1325)
* Fixed bug with incorrect multiple words processing
* Convert subcommand string to lower case
* Update SubcommandStrategyResolver.php
* Added test coverage
* Codestyle fixes
---------
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
* Added support for FUNCTION DUMP, FUNCTION FLUSH, FUNCTION RESTORE commands (#1332)
* Added support for CLIENT NO-EVICT command (#1335)
* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands (#1334)
* Added support for FUNCTION KILL, FUNCTION LIST, FUNCTION STATS commands
* Marked tests as relay-incompatible
* Added support for tests running against redis cluster (#1236)
* Added support for tests running against redis cluster
* Test coverage
* Added comment about master nodes
* Codestyle fix
* Revert changes
* Revert DBNUM
* Added cluster endpoints to relay tests env configuration
* Exclude cluster tests from relay tests environment
* Removed TODO comment
* Changed cluster image version to unstable
* Updated configuration to match unstable cluster
* Fixed path
* Updated cluster CI configuration
* Removed redundant flag
* Removed backslash
* Updated file path
* Updated file path variable
* Added docker cluster initialization as additional step
* Run cluster tests as separate workflow
* Codestyle fixes
* Updated exported files
* Added additional timeout so cluster image could be settled
* Added support for different cluster image, use docker compose for cluster tests CI
* Remove unused flag
* Removed variable from volume path
* Added sleep timeout to allow docker setup after running
* Added timeout before tests run
* Updated linter settings
* Include indent changes for.sh files
* Added missing coverage
* Revert expected files and mark docker folder as exclusion
* Specify folder itself as excluded
* Moved cluster tests as separate job in tests.yml
* Updated name to contain cluster word
---------
Co-authored-by: Chayim <chayim@users.noreply.github.com>
---------
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
---------
Co-authored-by: Till Krüss <tillkruss@users.noreply.github.com>
Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Added support for tests running against redis cluster
* Test coverage
* Added comment about master nodes
* Codestyle fix
* Revert changes
* Revert DBNUM
* Added cluster endpoints to relay tests env configuration
* Exclude cluster tests from relay tests environment
* Removed TODO comment
* Changed cluster image version to unstable
* Updated configuration to match unstable cluster
* Fixed path
* Updated cluster CI configuration
* Removed redundant flag
* Removed backslash
* Updated file path
* Updated file path variable
* Added docker cluster initialization as additional step
* Run cluster tests as separate workflow
* Codestyle fixes
* Updated exported files
* Added additional timeout so cluster image could be settled
* Added support for different cluster image, use docker compose for cluster tests CI
* Remove unused flag
* Removed variable from volume path
* Added sleep timeout to allow docker setup after running
* Added timeout before tests run
* Updated linter settings
* Include indent changes for.sh files
* Added missing coverage
* Revert expected files and mark docker folder as exclusion
* Specify folder itself as excluded
* Moved cluster tests as separate job in tests.yml
* Updated name to contain cluster word
---------
Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Added support for sharded pub/sub consumer
* Removed query parameter
* Fix typo
* Codestyle fixes
* Added support for sharded pub/sub against DispatcherLoop
* Updated sharded consumer example to subscribe on differend shard channels
* Added test coverage
* Removed cluster condition for pub/sub
* Codestyle fixes
* Changed socket read interface, added parameters as dependency to cluster connection
* Added for interface consistency
* Updated method description
* Updated method description
* Removed redundant exception
* Codestyle fix
* Updated README
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Mark tests as relay-incompatible
* Moved sharded pub/sub functionality to new consumer
* Codestyle fixes
* Resolve context depends on connection type
* Codestyle fixes
* Fix almost all PHPStan level 2 problems
* Fix master loop and remove empty line
* Fix variadic functions
* Fix CS
* Disable xdebug in CI and improve a condition
* Fix CI fix
This change actually had a positive impact on the design of the whole
internals for clustering which is now cleaner and easier to maintain.
It is still far from perfect, but we also have to keep performances in
consideration so we can say that we ended up with a good compromise.
Previously Predis assigned an hash to each command instance which was
computed from its key, now we changed approach and the library caches
the slot assigned to each command. This works for both our client-side
sharding cluster and the upcoming redis-cluster, but the former is the
one that needed most changes.
The PredisCluster aggregate connection now only takes an instance of
StrategyInterface, which in turn wraps the chosen distributor. After
all, in order to be able to calculate the assigned slot for a command
or key, the cluster strategy must have access to the distributor that
manages the distribution of the whole keyspace. Nothing really changes
in terms of configurability as it is still possible to decide which
distributor to use for client-side sharding, it is simply different:
$distributor = new Predis\Cluster\Distribution\KetamaRing();
$strategy = new Predis\Cluster\PredisStrategy($distributor);
$cluster = new Predis\Connection\Aggregate\PredisCluster($strategy);
As for the RedisCluster aggregate connection, the only change is that
the mathematical operation of calculating the assigned slot from a key
has been completely moved inside the cluster strategy instance.
The strategy for redis-cluster does not use external distributors so
trying to StrategyInterface::getDistributor() will throw an exception.
This may change in future releases, but this is not a priority since
redis-cluster relies on a fixed, well-defined distribution mechanism.