summaryrefslogtreecommitdiff
path: root/tests/test_cluster.py
Commit message (Collapse)AuthorAgeFilesLines
* Add support for cluster myshardid (#2704)Anurag Bandyopadhyay2023-05-081-0/+7
| | | | | | | | | | | | | | | | | | | * feat: adding support for cluster myshardid * lint fix * fix: comment fix and async test * fix: adding version check * fix lint: * linters --------- Co-authored-by: Anuragkillswitch <70265851+Anuragkillswitch@users.noreply.github.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Add RedisCluster.remap_host_port, Update tests for CWE 404 (#2706)Kristján Valur Jónsson2023-05-071-17/+4
| | | | | | | | | | | | | | | | | | | | | | * Use provided redis address. Bind to IPv4 * Add missing "await" and perform the correct test for pipe eimpty * Wait for a send event, rather than rely on sleep time. Excpect cancel errors. * set delay to 0 except for operation we want to cancel This speeds up the unit tests considerably by eliminating unnecessary delay. * Release resources in test * Fix cluster test to use address_remap and multiple proxies. * Use context manager to manage DelayProxy * Mark failing pipeline tests * lint * Use a common "master_host" test fixture
* add "address_remap" feature to RedisCluster (#2726)Kristján Valur Jónsson2023-05-021-0/+129
| | | | | | | | | | | | | | | * add cluster "host_port_remap" feature for asyncio.RedisCluster * Add a unittest for asyncio.RedisCluster * Add host_port_remap to _sync_ RedisCluster * add synchronous tests * rename arg to `address_remap` and take and return an address tuple. * Add class documentation * Add CHANGES
* add queue_class to REDIS_ALLOWED_KEYS (#2577)Dongkeun Lee2023-03-161-0/+13
| | | | | | | | | | | | * add queue_class to REDIS_ALLOWED_KEYS * fix lint * fix lint --------- Co-authored-by: zach.lee <zach.lee@sendbird.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Fix unlink in cluster pipeline (#2562)gmbnomis2023-01-291-0/+19
| | | | Implement unlink() like delete() to make it work when used in a cluster pipeline.
* add support for custom connection pool class in NodesManager (#2547)Dongkeun Lee2023-01-111-1/+16
| | | Co-authored-by: zach.lee <zach.lee@sendbird.com>
* allow replica to master promotion in nodes_cache (#2549)Dongkeun Lee2023-01-111-0/+51
| | | Co-authored-by: zach.lee <zach.lee@sendbird.com>
* Allow EVAL_RO and EVALSHA_RO to be routed to read replica (#2494)Dongkeun Lee2022-12-251-1/+9
| | | | | | | | | | | | * fix typo (Lue -> Lua) * run eval_ro, evalsha_ro test on redis cluster * Add eval_ro, evalsha_ro to read only commands * assert that commands are run in a round robin manner Co-authored-by: zach.lee <zach.lee@sendbird.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Raising NotImplementedError for certain CLUSTER commands (#2504)dvora-h2022-12-141-0/+8
| | | Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Combine auto-concatenated strings (#2482)David Gilman2022-12-141-4/+4
|
* Added a replacement for the default cluster node in the event of failure. ↵Bar Shaul2022-12-011-0/+23
| | | | (#2463)
* Failover handling improvements for RedisCluster and Async RedisCluster (#2377)Bar Shaul2022-11-101-0/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Cluster&AsyncCluster: Removed handling of timeouts/connection errors within the cluster loop, fixed "cannot pickle '_thread.lock' object" bug, added client's side failover handling improvements * Fixed linters * Type fixes * Added to CHANGES * Added getter and setter for the client's retry object and added more tests * Fixed linters * Fixed test * Fixed test_client_kill test * Changed get_default_backoff to default_backoff, removed retry_on_error and connection_error_retry_attempts from RedisCluster, default retry changed to no retries * Fixing linters * Reverting deletion of connection_error_retry_attempts to maintain backward compatibility * Updating retry object for existing and new connections * Changed the default value of reinitialize_steps from 10 to 5 * fix review comments Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* docs: Fix a few typos (#2274)Tim Gates2022-07-241-1/+1
| | | | | | | | | | | | | | | | | * docs: Fix a few typos There are small typos in: - redis/cluster.py - redis/commands/core.py - redis/ocsp.py - tests/test_cluster.py Fixes: - Should read `validity` rather than `valididy`. - Should read `reinitialize` rather than `reinitilize`. - Should read `farthest` rather than `farest`. - Should read `commands` rather than `comamnds`. * Update core.py
* Added dynamic_startup_nodes configuration to RedisCluster. (#2244)Bar Shaul2022-06-231-1/+22
| | | | | | | | | * Added dynamic_startup_nodes configuration to RedisCluster. By default, uses only the initial passed startup nodes to refresh the cluster topology. If set to true, sets the startup nodes to all of the discovered nodes. * Added RedisCluster specific options to the README file and updated CHANGES * Fixed timeout_error_topology_refresh test Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Reuse the old nodes' connections when a cluster topology refresh is being ↵Bar Shaul2022-06-231-0/+40
| | | | | | | | | | | | | done (#2235) * A fix was made to reuse the old nodes' connections when a cluster topology refresh is being done * Fixed RedisCluster to immediately raise AuthenticationError * Updated CHANGES * Fixed cluster async bgsave test to ignore "bgsave already in progress" error * Fixed linters
* Fix tests for Redis 7 (#2182)dvora-h2022-05-311-11/+26
| | | | | * fix tests * async
* update black to 22.3.0 (#2171)Utkarsh Gupta2022-05-301-54/+10
|
* Get command keys for subcommands (#2170)dvora-h2022-05-081-1/+0
| | | | | * parse subcommands * fix tests
* Add support for CLUSTER SHARDS (#2151)dvora-h2022-05-081-0/+23
| | | | | | | | | * Add support for CLUSTER SHARDS * linters * add docstring * linters
* Add Async RedisCluster (#2099)Utkarsh Gupta2022-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Copy Cluster Client, Commands, Commands Parser, Tests for asyncio * Async Cluster Tests: Async/Await * Add Async RedisCluster * cluster: use ERRORS_ALLOW_RETRY from self.__class__ * async_cluster: rework redis_connection, initialize, & close - move redis_connection from NodesManager to ClusterNode & handle all related logic in ClusterNode class - use Locks while initializing or closing - in case of error, close connections instead of instantly reinitializing - create ResourceWarning instead of manually deleting client object - use asyncio.gather to run commands/initialize/close in parallel - inline single use functions - fix test_acl_log for py3.6 * async_cluster: add types * async_cluster: add docs * docs: update sphinx & add sphinx_autodoc_typehints * async_cluster: move TargetNodesT to cluster module * async_cluster/commands: inherit commands from sync class if possible * async_cluster: add benchmark script with aredis & aioredis-cluster * async_cluster: remove logging * async_cluster: inline functions * async_cluster: manage Connection instead of Redis Client * async_cluster/commands: optimize parser * async_cluster: use ensure_future & generators for gather * async_conn: optimize * async_cluster: optimize determine_slot * async_cluster: optimize determine_nodes * async_cluster/parser: optimize _get_moveable_keys * async_cluster: inlined check_slots_coverage * async_cluster: update docstrings * async_cluster: add concurrent test & use read_response/_update_moved_slots without lock Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Extended "CLUSTER NODES" parser to support special slot entries (importing, ↵Bar Shaul2022-04-041-0/+37
| | | | | | | migrating). (#2080) See https://redis.io/commands/cluster-nodes/#special-slot-entries Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Clean up test supoort enterprise environments (#2082)dvora-h2022-04-041-0/+27
| | | | | * skip tests on enterprise * delete dping implementation
* Add support for CLUSTER MYID (#2063)Binbin2022-03-311-0/+5
| | | Co-authored-by: enjoy-binbin <binbin.zhu@tenclass.com>
* [CLUSTER] Fix scan command cursors & Fix scan_iter (#2054)Utkarsh Gupta2022-03-231-14/+45
| | | | | | | * cluster/scan: fix return cursor & change default node to primaries * cluster/scan_iter: fix iteration Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Add support for CLUSTER LINKS (#2019)dvora-h2022-03-141-0/+11
| | | | | | | | | * cluster links * docstring * skip test Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Add support for CLUSTER DELSLOTSRANGE (#2018)dvora-h2022-03-141-0/+7
| | | | | | | | | | | * delslotsrange * test * linters * skip test * linters
* Add support for CLUSTER ADDSLOTSRANGE (#2017)dvora-h2022-03-141-0/+6
| | | | | | | | | | | | | * add cluster addslotsrange * Add support for CLUSTER ADDSLOTSRANGE * docstring * fix test * skip test * linters
* Fix flushdb and flushall (#1926)Meir Shpilraien (Spielrein)2022-02-071-0/+7
| | | | | | | | | | | | | | * Fix flushdb and flushall Both commands should be broadcasted to all the shards. * Support ssl_password on cluster * linter fix * change commands to run only on primary nodes Co-authored-by: Chayim I. Kirshen <c@kirshen.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Clusters should optionally require full slot coverage (#1845)Bar Shaul2022-01-101-54/+32
|
* Retry on error exception and timeout fixes (#1821)Bar Shaul2021-12-231-30/+9
|
* Fix cluster ACL tests (#1774)Bar Shaul2021-12-081-1/+1
|
* Added support for MONITOR in clusters (#1756)Bar Shaul2021-12-021-1/+53
|
* Improved RedisCluster's reinitialize_steps and documentation (#1765)Bar Shaul2021-12-021-1/+19
|
* Migrated targeted nodes to kwargs in Cluster Mode (#1762)Bar Shaul2021-12-011-6/+57
|
* Added black and isort (#1734)Anas2021-11-301-831/+918
|
* Pyupgrade + flynt + f-strings (#1759)Aarni Koskela2021-11-301-14/+9
| | | @akx Thank you so much for this! Thanks again for introducing me to a new tool that I'm sliding into my workflow as well.
* Adding RedisCluster client to support Redis Cluster Mode (#1660)Bar Shaul2021-11-251-0/+2482
Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Anas <anas.el.amraoui@live.com>