summaryrefslogtreecommitdiff
path: root/redis/asyncio/cluster.py
Commit message (Collapse)AuthorAgeFilesLines
* Optionally disable disconnects in read_response (#2695)Kristján Valur Jónsson2023-05-081-24/+9
| | | | | | | | | | | | | * Add regression tests and fixes for issue #1128 * Fix tests for resumable read_response to use "disconnect_on_error" * undo prevision fix attempts in async client and cluster * re-enable cluster test * Suggestions from code review * Add CHANGES
* add "address_remap" feature to RedisCluster (#2726)Kristján Valur Jónsson2023-05-021-1/+30
| | | | | | | | | | | | | | | * 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
* Fixing cancelled async futures (#2666)Chayim2023-03-291-7/+14
| | | | | Co-authored-by: James R T <jamestiotio@gmail.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* AsyncIO Race Condition Fix (#2641)v4.5.3Chayim2023-03-221-2/+10
|
* Async clusters: Support creating locks inside async functions (#2471)Utkarsh Gupta2022-12-041-1/+5
| | | Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Async: added 'blocking' argument to call lock method (#2454)Sibuken2022-12-011-0/+8
| | | Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Added a replacement for the default cluster node in the event of failure. ↵Bar Shaul2022-12-011-1/+21
| | | | (#2463)
* Failover handling improvements for RedisCluster and Async RedisCluster (#2377)Bar Shaul2022-11-101-58/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* CredentialsProvider class added to support password rotation (#2261)Bar Shaul2022-11-101-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * A CredentialsProvider class has been added to allow the user to add his own provider for password rotation * Moved CredentialsProvider to a separate file, added type hints * Changed username and password to properties * Added: StaticCredentialProvider, examples, tests Changed: CredentialsProvider to CredentialProvider Fixed: calling AUTH only with password * Changed private members' prefix to __ * fixed linters * fixed auth test * fixed credential test * Raise an error if username or password are passed along with credential_provider * fixing linters * fixing test * Changed dundered to single per side underscore * Changed Connection class members username and password to properties to enable backward compatibility with changing the members value on existing connection. * Reverting last commit and adding backward compatibility to 'username' and 'password' inside on_connect function * Refactored CredentialProvider class * Fixing tuple type to Tuple * Fixing optional string members in UsernamePasswordCredentialProvider * Fixed credential test * Added credential provider support to AsyncRedis * linters * linters * linters * linters - black Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
* Fix special response parsing options handling (#2302)Shay Fadida2022-11-091-0/+4
| | | | | | | | | | | | | | | | | * Fix special response parsing options handling When using special response parsing options like `NEVER_DECODE` and `EMPTY_RESPONSE`, don't pass them to the response callbacks because some of them are not prepared for receiving named arguments. Instead, redis-py should use them before calling the callbacks and then discard them. * Use kwargs instead of options * change options to kwargs in asyncio/cluster.py/L878 Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* Enable AsyncIO cluster mode lock (#2446)Milhan2022-11-091-0/+67
| | | Co-authored-by: Chayim <chayim@users.noreply.github.com>
* Dev/no lock (#2308)Kristján Valur Jónsson2022-09-281-5/+3
| | | | | * Remove async lock in asyncio.Connection.read_response * Skip concurrent-commands test on non-pooled connections
* Replace `ensure_future` with `create_task` (#2311)dvora-h2022-08-021-6/+6
| | | | | * Replace `ensure_future` with `create_task` * linters
* Drop python 3.6 support (#2306)dvora-h2022-07-271-4/+2
|
* async_cluster: fix max_connections/ssl & improve args (#2217)Utkarsh Gupta2022-07-271-181/+196
| | | | | | | | | | | | | | | | | | | | | | * async_cluster: fix max_connections/ssl & improve args - set proper connection_class if ssl = True - pass max_connections/connection_class to ClusterNode - recreate startup_nodes to properly initialize - pass parser_class to Connection instead of changing it in on_connect - only pass redis_connect_func if read_from_replicas = True - add connection_error_retry_attempts parameter - skip is_connected check in acquire_connection as it is already checked in send_packed_command BREAKING: - RedisCluster args except host & port are kw-only now - RedisCluster will no longer accept unknown arguments - RedisCluster will no longer accept url as an argument. Use RedisCluster.from_url - RedisCluster.require_full_coverage defaults to True - ClusterNode args except host, port, & server_type are kw-only now * async_cluster: remove kw-only requirement from client Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* async_cluster: fix concurrent pipeline (#2280)Utkarsh Gupta2022-07-241-9/+9
| | | - each pipeline should create separate stacks for each node
* commands/cluster: use pipeline to execute split commands (#2230)Utkarsh Gupta2022-06-271-6/+11
| | | | | | - allow passing target_nodes to pipeline commands - move READ_COMMANDS to commands/cluster to avoid import cycle - add types to list_or_args
* async_cluster: fix simultaneous initialize (#2231)Utkarsh Gupta2022-06-191-2/+2
| | | - close startup_nodes too during client.close(), in case they are different
* async_cluster: improve docs (#2208)Utkarsh Gupta2022-06-021-36/+37
| | | | - move response_callbacks kwarg inside __init__ to hide it from docs - use :member-order: bysource to group similar commands together
* async_cluster: optimisations (#2205)Utkarsh Gupta2022-06-011-79/+86
| | | | | | | | | | - return true from execute_pipeline if there are any errors - use todo list to speedup retries - store initialisation node in CommandsParser object - add sync context manager for pipeline - use if/else instead of try/except - make command a function argument in _determine_nodes & _determine_slot - add async cluster pipeline benchmark script
* async_cluster: add pipeline support (#2199)Utkarsh Gupta2022-05-301-16/+312
| | | Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
* update black to 22.3.0 (#2171)Utkarsh Gupta2022-05-301-1/+1
|
* async_cluster: add/update typing (#2195)Utkarsh Gupta2022-05-301-71/+91
| | | | | | | * async_cluster: add/update typing * async_cluster: update cleanup_kwargs with kwargs from async Connection * async_cluster: properly remove old nodes
* set default response_callbacks to redis.asyncio.cluster.ClusterNode (#2201)rapidia2022-05-301-1/+1
| | | | | | | | | * set default response_callbacks to redis.asyncio.cluster.ClusterNode * add test case for ClusterNode class * fix lint error * merge test case into `test_startup_nodes`
* Add Async RedisCluster (#2099)Utkarsh Gupta2022-05-081-0/+1113
* 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>