Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
dd2ee3f
Add dynamic_startup_nodes parameter to async RedisCluster
Kakadus Nov 28, 2024
c7fa2a9
Merge branch 'master' into add-dynamic-startup-nodes-flag-to-async-re…
Kakadus Dec 30, 2024
32d45c9
Fixed flacky TokenManager test (#3468)
vladvildanov Dec 30, 2024
3f4cde2
Fix incorrect attribute reuse (#3456)
zs-neo Dec 30, 2024
cf181be
Expand type for EncodedT (#3472)
hauntsaninja Jan 6, 2025
0898252
Moved self._lock initialisation to Pool constructor (#3473)
vladvildanov Jan 6, 2025
08e9e17
Changed default dialect to 2 (#3467)
vladvildanov Jan 9, 2025
58c1604
Moved ClusterParser exceptions to BaseParser class (#3475)
vladvildanov Jan 15, 2025
570ac92
DOC-4423: add TCEs for various command pages (#3476)
dwdougherty Jan 17, 2025
1c8af3a
DOC-4345 added testable JSON search examples for home page (#3407)
andy-stark-redis Jan 21, 2025
0d79013
Added Redis 8.0 to test matrix (#3469)
vladvildanov Jan 21, 2025
c60c41c
Updated test infrastructure with latest versions (#3484)
vladvildanov Jan 28, 2025
10f3a4b
Adding unit text fixes to improve compatibility with MacOS. (#3486)
petyaslavova Jan 28, 2025
c98c6eb
fix: update redis university url, the old link doesn't work (#3481)
niklasbec Jan 28, 2025
4a8da2a
Adding tests for modules ACL and modules config changes in 8.0 (#3489)
petyaslavova Jan 30, 2025
f463557
Add return type to `close` functions (#3496)
patrick91 Feb 4, 2025
2f0fb9a
Update Python imports in doctests (index_definition => indexDefinitio…
dwdougherty Feb 4, 2025
9cadd6d
Add types to ConnectionPool.from_url (#3495)
patrick91 Feb 4, 2025
c07b599
Add types to execute method of pipelines (#3494)
patrick91 Feb 6, 2025
8091bdb
DOC-4796 fixed capped lists example (#3493)
andy-stark-redis Feb 6, 2025
8604a50
Adding deprecation messages for the exposed in search module commands…
petyaslavova Feb 7, 2025
996c48b
typing for client __init__ (#3357)
Vulwsztyn Feb 10, 2025
fd1e205
Since commands info and ft.info do not return redundant information -…
petyaslavova Feb 10, 2025
f614abf
test: Updated CredentialProvider test infrastructure (#3502)
vladvildanov Feb 11, 2025
c5a42fc
Fixes minor grammar nit in documentation. (#3354)
cavemanpi Feb 11, 2025
a8ff646
maintenance: Adding Python 3.13 compatibility (#3510)
vladvildanov Feb 13, 2025
6129912
Fix Incorrect markdown formatting for example in connection_examples.…
paololazzari Feb 13, 2025
2065ea7
Adding unit test for core info command related to modules info (#3507)
petyaslavova Feb 13, 2025
83162c2
Replacing the redis and redis-stack-server images with redis-libs-tes…
petyaslavova Feb 13, 2025
2b3420c
Fix formatting in README.md - 'Note' - bold formatting (#3413)
BaseMax Feb 13, 2025
d912801
Adding dev_requirements.txt and pytest.ini resources into sdist. Fix…
petyaslavova Feb 13, 2025
27c83de
Reinitialize the cluster in case of TimeoutError inside a pipeline (#…
mbilski Feb 17, 2025
9ea0e25
Fix inaccurate docstring for unwatch() (#3424)
djroze Feb 18, 2025
9834cfa
Fix invalid return type annotation (#3480)
birthdaysgift Feb 19, 2025
e77940f
Deprecating unused arguments in connection pools's get_connection fun…
petyaslavova Feb 20, 2025
c788cd4
Type hint Lock.extend's additional_time as a Number (#3522)
Perlence Feb 21, 2025
70142d8
Remove decreasing of created connections count when releasing not own…
petyaslavova Feb 24, 2025
5cbc526
Switch to PEP 517 packaging using hatchling (#2930)
akx Feb 25, 2025
2324ab2
Removing the requirements.txt from docs building dependencies (#3527)
petyaslavova Feb 25, 2025
005367b
Installing redis and its mandatory dependencies when building readthe…
petyaslavova Feb 25, 2025
c58b590
Adding vector search tests for types int8/uint8 (#3525)
petyaslavova Feb 25, 2025
126f28a
Fixing wrong type hints (#3526)
petyaslavova Feb 25, 2025
c7c896e
Fix readthedocs.yml format for python install configuration (#3529)
petyaslavova Feb 26, 2025
dec26ff
Add valid Exception type to Except in ClusterPipeline (#3516)
bssyousefi Feb 26, 2025
8339b16
Make PyJWT an optional dependency (#3518)
akx Feb 27, 2025
797c59f
Add force_master_ip support to async Sentinel client (#3524)
666romeo Feb 27, 2025
77193ce
Fixing typing for FCALL commands to match PEP 484 (#3537)
vladvildanov Feb 28, 2025
6c81598
fix(lock): Fix LockError message when releasing a lock. (#3534)
shenxiangzhuang Mar 4, 2025
04eafb8
Bump rojopolis/spellcheck-github-actions from 0.38.0 to 0.47.0 (#3538)
dependabot[bot] Mar 4, 2025
d540d56
Fix client_list with multiple client ids (#3539)
three-kinds Mar 4, 2025
5b5340f
Fix connection health check for protocol != 2 when auth credentials a…
Yard1 Mar 5, 2025
5eb9939
Isolate redis-entraid dependency for tests (#3521)
akx Mar 5, 2025
dea3d9a
Replace flake8+isort+black with `ruff` (#3147)
akx Mar 5, 2025
1de69f5
Correct the typedef of lock.extend() to accept floats, and test that …
nbertram Mar 6, 2025
9be806a
Removing deprecated usage of forbid_global_loop=True in pytest.mark.a…
petyaslavova Mar 6, 2025
8a28b96
(tests): Added testing for auth via DefaultAzureCredential (#3544)
vladvildanov Mar 6, 2025
74977eb
Fix AttributeError when client.get_default_node() returns None (#3458)
bacchuswng Mar 10, 2025
4f0ee91
feat: adds option not to raise exception when leaving context manager…
julianolm Mar 10, 2025
333fd8f
Got rid of `time.time()`- replacing it with time.monotonic(). (#3551)
excitoon Mar 10, 2025
83db949
allow more recent pyopenssl (#3541)
dimbleby Mar 10, 2025
d30ebd1
Fix #3464: Correct misleading exception_handler example in docs (#3474)
byeongjulee222 Mar 10, 2025
dc8359f
Removing support for RedisGraph module. (#3548)
petyaslavova Mar 11, 2025
6c7acbd
DOC-4736 added geo indexing examples (#3485)
andy-stark-redis Mar 11, 2025
4bd3656
Fixing async cluster pipeline execution when client is created with c…
petyaslavova Mar 12, 2025
d18922f
Avoid the multiprocessing forkserver method (#3442)
befeleme Mar 12, 2025
c39c48d
Avoid stacktrace on process exit in Client.__del__() (#3397)
noirbee Mar 12, 2025
527a98f
Increasing the operations-per-run for stale issues GH action (#3556)
petyaslavova Mar 13, 2025
24bb8f4
Removing support for RedisGears module. (#3553)
petyaslavova Mar 13, 2025
944f010
skip `ssl` import if not available (#3078)
dicej Mar 14, 2025
540c3e8
Fixing search module dropindex function not to send invalid third par…
petyaslavova Mar 18, 2025
decec9a
fix: add TimeoutError handling in get_connection() (#1485)
donbowman Mar 18, 2025
c744366
Adding load balancing strategy configuration to cluster clients(repla…
petyaslavova Mar 19, 2025
13e68af
Exponential with jitter backoff (#3550)
JimNero009 Mar 24, 2025
09c6ff9
Adding new hash commands with expiration options - HGETDEL, HGETEX, H…
petyaslavova Mar 24, 2025
a9d0260
Truncate pipeline exception message to a sane size (#3530)
rohansingh Mar 25, 2025
8df6a6c
Support using ssl.VerifyMode enum for ssl_cert_reqs (#3346)
lattwood Mar 25, 2025
9f90baf
Improvement: Use `shutdown()` Before `close()` in connection.py (#3567)
allrob23 Mar 26, 2025
4e2da48
Fixed infinitely recursive health checks. (#3557)
excitoon Mar 26, 2025
4525c2d
Fix incorrect link to docs for fcall_ro command (#3576)
paololazzari Mar 27, 2025
56e61f8
Docs/raae 724/remove redis ventures (#3579)
rbs333 Apr 2, 2025
71916ee
Bump rojopolis/spellcheck-github-actions from 0.47.0 to 0.48.0 (#3580)
dependabot[bot] Apr 3, 2025
8093674
Run pipeline tests against latest 8.0 RC1 image. (#3585)
petyaslavova Apr 4, 2025
e66e35c
Adding info for sentinel handling failover when Redis client is acqui…
petyaslavova Apr 4, 2025
6c07473
Adding VectorSet commands support. (#3584)
petyaslavova Apr 7, 2025
266c59c
DOC-5073 added examples for vector sets intro page (#3590)
andy-stark-redis Apr 9, 2025
9a64797
Fixing some sporadically failing tests - part 1 (#3589)
petyaslavova Apr 9, 2025
19b9b72
DOC-5073 vector set quantization and dimension reduction examples (#3…
andy-stark-redis Apr 14, 2025
4f17745
Removing 'charset' and 'errors' inputs from the Redis initialization …
petyaslavova Apr 17, 2025
8bcccd4
DOC-5107 added hash examples for index/query intro page (#3609)
andy-stark-redis Apr 23, 2025
f5d5ff3
Marks old RediSearch 1.0 commands as deprecated (#3606)
elena-kolevska Apr 24, 2025
d02fbbb
Fixing flaky tests - part 2 (#3592)
petyaslavova Apr 28, 2025
6573d38
Updating default retry strategy for standalone clients. 3 retries wit…
petyaslavova Apr 28, 2025
8dadea2
Handling some special values when transforming responce data into lis…
petyaslavova Apr 29, 2025
fb547af
When SlotNotCoveredError is raised, the cluster topology should be re…
petyaslavova Apr 29, 2025
c918139
Fixing the versions of some deprecations that wrongly added as 5.0.3 …
petyaslavova Apr 30, 2025
cf5c755
Updating pipeline tests to use test libs image with RC2. Updating tim…
petyaslavova Apr 30, 2025
5fe120d
Updated default value of 'require_full_coverage' argument to true for…
vladvildanov Apr 30, 2025
41fdadb
Adding default retry configuration changes for cluster clients (#3622)
petyaslavova Apr 30, 2025
c980e95
Changing the default value for ssl_check_hostname to True, to ensure …
petyaslavova Apr 30, 2025
c40b98c
Fix AttributeError on ClusterPipeline (#3634)
sentrivana May 5, 2025
18d3b32
add equality and hashability to ``Retry`` and backoff classes (#3628)
terencehonles May 7, 2025
436ad60
Change type hints with possible None args or return types to be annot…
kesha1225 May 8, 2025
07a4bbb
Allow newer PyJWT versions (#3636)
aberres May 8, 2025
fa3067d
Updating Redis 8 test image for GH pipeline (#3639)
petyaslavova May 8, 2025
f3dfbd4
Prevent RuntimeError while reinitializing clusters - sync and async (…
petyaslavova May 8, 2025
36fec15
Adding return types for the RedisModuleCommands class (#3632)
petyaslavova May 8, 2025
f69192a
Test against unstable hiredis-py (#3617)
uglide May 9, 2025
cda3fbd
Fix matrix in hiredis-py-integration.yaml (#3641)
uglide May 9, 2025
6ef5d71
Export REDIS_MAJOR_VERSION correctly in run-tests (#3642)
uglide May 12, 2025
a2f7e4b
Multi exec on cluster (#3611)
robertosantamaria-scopely May 12, 2025
ed35c58
Fix RedisCluster ssl_check_hostname not set to connections. For SSL …
omerfeyzioglu May 12, 2025
66d4a02
Updating the readme and lib version to contain the changes from the l…
petyaslavova May 13, 2025
7c600dc
Add dynamic_startup_nodes parameter to async RedisCluster
Kakadus Nov 28, 2024
6f53c02
Applying review comments
petyaslavova May 13, 2025
5868209
Merge branch 'master' into add-dynamic-startup-nodes-flag-to-async-re…
petyaslavova May 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Add dynamic_startup_nodes parameter to async RedisCluster (#2472)
* Move doctests (doc code examples) to main branch
* Update `ResponseT` type hint
* Allow to control the minimum SSL version
Expand Down
19 changes: 17 additions & 2 deletions redis/asyncio/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ class RedisCluster(AbstractRedis, AbstractRedisCluster, AsyncRedisClusterCommand
| Enable read from replicas in READONLY mode. You can read possibly stale data.
When set to true, read commands will be assigned between the primary and
its replications in a Round-Robin manner.
:param dynamic_startup_nodes:
| Set the RedisCluster's startup nodes to all the discovered nodes.
If true (default value), the cluster's discovered nodes will be used to
determine the cluster nodes-slots mapping in the next topology refresh.
It will remove the initial passed startup nodes if their endpoints aren't
listed in the CLUSTER SLOTS output.
If you use dynamic DNS endpoints for startup nodes but CLUSTER SLOTS lists
specific IP addresses, it is best to set it to false.
:param reinitialize_steps:
| Specifies the number of MOVED errors that need to occur before reinitializing
the whole cluster topology. If a MOVED error occurs and the cluster does not
Expand Down Expand Up @@ -236,6 +244,7 @@ def __init__(
startup_nodes: Optional[List["ClusterNode"]] = None,
require_full_coverage: bool = True,
read_from_replicas: bool = False,
dynamic_startup_nodes: bool = True,
reinitialize_steps: int = 5,
cluster_error_retry_attempts: int = 3,
connection_error_retry_attempts: int = 3,
Expand Down Expand Up @@ -379,6 +388,7 @@ def __init__(
startup_nodes,
require_full_coverage,
kwargs,
dynamic_startup_nodes=dynamic_startup_nodes,
address_remap=address_remap,
event_dispatcher=self._event_dispatcher,
)
Expand Down Expand Up @@ -1136,6 +1146,7 @@ class NodesManager:
"require_full_coverage",
"slots_cache",
"startup_nodes",
"_dynamic_startup_nodes",
"address_remap",
)

Expand All @@ -1144,12 +1155,14 @@ def __init__(
startup_nodes: List["ClusterNode"],
require_full_coverage: bool,
connection_kwargs: Dict[str, Any],
dynamic_startup_nodes: bool = True,
address_remap: Optional[Callable[[Tuple[str, int]], Tuple[str, int]]] = None,
event_dispatcher: Optional[EventDispatcher] = None,
) -> None:
self.startup_nodes = {node.name: node for node in startup_nodes}
self.require_full_coverage = require_full_coverage
self.connection_kwargs = connection_kwargs
self._dynamic_startup_nodes = dynamic_startup_nodes
self.address_remap = address_remap

self.default_node: "ClusterNode" = None
Expand Down Expand Up @@ -1392,8 +1405,10 @@ async def initialize(self) -> None:
# Set the tmp variables to the real variables
self.slots_cache = tmp_slots
self.set_nodes(self.nodes_cache, tmp_nodes_cache, remove_old=True)
# Populate the startup nodes with all discovered nodes
self.set_nodes(self.startup_nodes, self.nodes_cache, remove_old=True)

if self._dynamic_startup_nodes:
# Populate the startup nodes with all discovered nodes
self.set_nodes(self.startup_nodes, self.nodes_cache, remove_old=True)

# Set the default node
self.default_node = self.get_nodes_by_server_type(PRIMARY)[0]
Expand Down
21 changes: 21 additions & 0 deletions tests/test_asyncio/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2620,6 +2620,27 @@ def cmd_init_mock(self, r: ClusterNode) -> None:
assert rc.get_node(host=default_host, port=7001) is not None
assert rc.get_node(host=default_host, port=7002) is not None

@pytest.mark.parametrize("dynamic_startup_nodes", [True, False])
async def test_init_slots_dynamic_startup_nodes(self, dynamic_startup_nodes):
rc = await get_mocked_redis_client(
host="[email protected]",
port=7000,
cluster_slots=default_cluster_slots,
dynamic_startup_nodes=dynamic_startup_nodes,
)
# Nodes are taken from default_cluster_slots
discovered_nodes = [
"127.0.0.1:7000",
"127.0.0.1:7001",
"127.0.0.1:7002",
"127.0.0.1:7003",
]
startup_nodes = list(rc.nodes_manager.startup_nodes.keys())
if dynamic_startup_nodes is True:
assert startup_nodes.sort() == discovered_nodes.sort()
else:
assert startup_nodes == ["[email protected]:7000"]


class TestClusterPipeline:
"""Tests for the ClusterPipeline class."""
Expand Down