Skip to content

Commit 8d7cc00

Browse files
authored
Merge branch 'ps_hitless_upgrade_sync_redis' into ps_add_fail_over_events_handling
2 parents a8ba5ce + c3caf6a commit 8d7cc00

File tree

17 files changed

+1554
-728
lines changed

17 files changed

+1554
-728
lines changed

.github/workflows/integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
max-parallel: 15
7575
fail-fast: false
7676
matrix:
77-
redis-version: ['8.2-RC1-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9']
77+
redis-version: ['8.2', '${{ needs.redis_version.outputs.CURRENT }}', '7.4.4', '7.2.9']
7878
python-version: ['3.9', '3.13']
7979
parser-backend: ['plain']
8080
event-loop: ['asyncio']
@@ -99,7 +99,7 @@ jobs:
9999
fail-fast: false
100100
matrix:
101101
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
102-
python-version: ['3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
102+
python-version: ['3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
103103
parser-backend: [ 'plain' ]
104104
event-loop: [ 'asyncio' ]
105105
env:

redis/_parsers/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,20 @@ def handle_push_response(self, response, **kwargs):
202202
if msg_type in _INVALIDATION_MESSAGE and self.invalidation_push_handler_func:
203203
return self.invalidation_push_handler_func(response)
204204
if msg_type in _MOVING_MESSAGE and self.node_moving_push_handler_func:
205+
# TODO: PARSE latest format when available
205206
host, port = response[2].decode().split(":")
206207
ttl = response[1]
207208
id = 1 # Hardcoded value until the notification starts including the id
208209
notification = NodeMovingEvent(id, host, port, ttl)
209210
return self.node_moving_push_handler_func(notification)
210211
if msg_type in _MAINTENANCE_MESSAGES and self.maintenance_push_handler_func:
211212
if msg_type in _MIGRATING_MESSAGE:
213+
# TODO: PARSE latest format when available
212214
ttl = response[1]
213215
id = 2 # Hardcoded value until the notification starts including the id
214216
notification = NodeMigratingEvent(id, ttl)
215217
elif msg_type in _MIGRATED_MESSAGE:
218+
# TODO: PARSE latest format when available
216219
id = 3 # Hardcoded value until the notification starts including the id
217220
notification = NodeMigratedEvent(id)
218221
else:
@@ -260,17 +263,20 @@ async def handle_push_response(self, response, **kwargs):
260263
return await self.invalidation_push_handler_func(response)
261264
if msg_type in _MOVING_MESSAGE and self.node_moving_push_handler_func:
262265
# push notification from enterprise cluster for node moving
266+
# TODO: PARSE latest format when available
263267
host, port = response[2].split(":")
264268
ttl = response[1]
265269
id = 1 # Hardcoded value for async parser
266270
notification = NodeMovingEvent(id, host, port, ttl)
267271
return await self.node_moving_push_handler_func(notification)
268272
if msg_type in _MAINTENANCE_MESSAGES and self.maintenance_push_handler_func:
269273
if msg_type in _MIGRATING_MESSAGE:
274+
# TODO: PARSE latest format when available
270275
ttl = response[1]
271276
id = 2 # Hardcoded value for async parser
272277
notification = NodeMigratingEvent(id, ttl)
273278
elif msg_type in _MIGRATED_MESSAGE:
279+
# TODO: PARSE latest format when available
274280
id = 3 # Hardcoded value for async parser
275281
notification = NodeMigratedEvent(id)
276282
return await self.maintenance_push_handler_func(notification)
@@ -283,7 +289,7 @@ def set_invalidation_push_handler(self, invalidation_push_handler_func):
283289
"""Set the invalidation push handler function"""
284290
self.invalidation_push_handler_func = invalidation_push_handler_func
285291

286-
def set_node_moving_push_handler_func(self, node_moving_push_handler_func):
292+
def set_node_moving_push_handler(self, node_moving_push_handler_func):
287293
self.node_moving_push_handler_func = node_moving_push_handler_func
288294

289295
def set_maintenance_push_handler(self, maintenance_push_handler_func):

redis/asyncio/connection.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,8 +1308,6 @@ def __init__(
13081308
)
13091309
self._condition = asyncio.Condition()
13101310
self.timeout = timeout
1311-
self._in_maintenance = False
1312-
self._locked = False
13131311

13141312
@deprecated_args(
13151313
args_to_warn=["*"],

redis/cluster.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def parse_cluster_myshardid(resp, **options):
170170
"redis_connect_func",
171171
"password",
172172
"port",
173+
"timeout",
173174
"queue_class",
174175
"retry",
175176
"retry_on_timeout",
@@ -2716,8 +2717,8 @@ def send_cluster_commands(
27162717
27172718
If one of the retryable exceptions has been thrown we assume that:
27182719
- connection_pool was disconnected
2719-
- connection_pool was reseted
2720-
- refereh_table_asap set to True
2720+
- connection_pool was reset
2721+
- refresh_table_asap set to True
27212722
27222723
It will try the number of times specified by
27232724
the retries in config option "self.retry"

0 commit comments

Comments
 (0)