Commit 208a0d2
Hitless upgrades (#3021)
* feat(errors): Add specialized timeout error types for maintenance scenarios
- Added `SocketTimeoutDuringMaintananceError`, a subclass of `TimeoutError`, to handle socket timeouts during maintenance.
- Added `CommandTimeoutDuringMaintenanceError`, another subclass of `TimeoutError`, to address command write timeouts during maintenance.
* feat(linked-list): Add EmptyAwareSinglyLinkedList and enhance DoublyLinkedList functionality
- Introduced `EmptyAwareSinglyLinkedList`, a subclass of `SinglyLinkedList` that emits an `empty` event when the list becomes empty due to `reset`, `shift`, or `remove` operations.
- Added `nodes()` iterator method to `DoublyLinkedList` for iterating over nodes directly.
- Enhanced unit tests for `DoublyLinkedList` and `SinglyLinkedList` to cover edge cases and new functionality.
- Added comprehensive tests for `EmptyAwareSinglyLinkedList` to validate `empty` event emission under various scenarios.
- Improved code formatting and consistency.
* refactor(commands-queue): Improve push notification handling
- Replaced `setInvalidateCallback` with a more flexible `addPushHandler` method, allowing multiple handlers for push notifications.
- Introduced the `PushHandler` type to standardize push notification processing.
- Refactored `RedisCommandsQueue` to use a `#pushHandlers` array, enabling dynamic and modular handling of push notifications.
- Updated `RedisClient` to leverage the new handler mechanism for `invalidate` push notifications, simplifying and decoupling logic.
* feat(commands-queue): Add method to wait for in-flight commands to complete
- Introduced `waitForInflightCommandsToComplete` method to asynchronously wait for all in-flight commands to finish processing.
- Utilized the `empty` event from `#waitingForReply` to signal when all commands have been completed.
* feat(commands-queue): Introduce maintenance mode support for commands-queue
- Added `#maintenanceCommandTimeout` and `setMaintenanceCommandTimeout` method to dynamically adjust command timeouts during maintenance
* refator(client): Extract socket event listener setup into helper method
* refactor(socket): Add maintenance mode support and dynamic timeout handling
- Added `#maintenanceTimeout` and `setMaintenanceTimeout` method to dynamically adjust socket timeouts during maintenance.
* feat(client): Add Redis Enterprise maintenance configuration options
- Added `maintPushNotifications` option to control how the client handles Redis Enterprise maintenance push notifications (`disabled`, `enabled`, `au
to`).
- Added `maintMovingEndpointType` option to specify the endpoint type for reconnecting during a MOVING notification (`auto`, `internal-ip`, `external-ip`,
etc.).
- Added `maintRelaxedCommandTimeout` option to define a relaxed timeout for commands during maintenance.
- Added `maintRelaxedSocketTimeout` option to define a relaxed timeout for the socket during maintenance.
- Enforced RESP3 requirement for maintenance-related features (`maintPushNotifications`).
* feat(client): Add socket helpers and pause mechanism
- Introduced `#paused` flag with corresponding `_pause` and `_unpause` methods to
temporarily halt writing commands to the socket during maintenance windows.
- Updated `#write` method to respect the `#paused` flag, preventing new commands from being written during maintenance.
- Added `_ejectSocket` method to safely detach from and return the current socket
- Added `_insertSocket` method to receive and start using a new socket
* feat(client): Add Redis Enterprise maintenance handling capabilities
- Introduced `EnterpriseMaintenanceManager` to manage Redis Enterprise maintenance events and push notifications.
- Integrated `EnterpriseMaintenanceManager` into `RedisClient` to handle maintenance push notifications and manage socket transitions.
- Implemented graceful handling of MOVING, MIGRATING, and FAILOVER push notifications, including socket replacement and timeout adjustments.
* test: add E2E test infrastructure for Redis maintenance scenarios
* test: add E2E tests for Redis Enterprise maintenance timeout handling (#3)
* test: add connection handoff test
---------
Co-authored-by: Pavel Pashov <[email protected]>
Co-authored-by: Pavel Pashov <[email protected]>1 parent 6ad4c68 commit 208a0d2
File tree
20 files changed
+1635
-117
lines changed- packages
- bloom
- client/lib
- client
- tests/test-scenario
- entraid
- json
- redis
- search
- time-series
20 files changed
+1635
-117
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
56 | 65 | | |
57 | | - | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
61 | 70 | | |
62 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
63 | 119 | | |
64 | 120 | | |
65 | 121 | | |
66 | 122 | | |
67 | | - | |
68 | | - | |
69 | 123 | | |
70 | 124 | | |
71 | 125 | | |
| |||
107 | 161 | | |
108 | 162 | | |
109 | 163 | | |
| 164 | + | |
110 | 165 | | |
111 | 166 | | |
112 | 167 | | |
| |||
119 | 174 | | |
120 | 175 | | |
121 | 176 | | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 177 | + | |
| 178 | + | |
138 | 179 | | |
139 | 180 | | |
140 | 181 | | |
141 | 182 | | |
142 | 183 | | |
143 | 184 | | |
144 | | - | |
145 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
146 | 198 | | |
147 | 199 | | |
148 | 200 | | |
| |||
168 | 220 | | |
169 | 221 | | |
170 | 222 | | |
171 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
172 | 227 | | |
| 228 | + | |
173 | 229 | | |
174 | 230 | | |
175 | 231 | | |
176 | 232 | | |
177 | 233 | | |
178 | | - | |
179 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
180 | 237 | | |
181 | 238 | | |
182 | 239 | | |
| |||
432 | 489 | | |
433 | 490 | | |
434 | 491 | | |
435 | | - | |
| 492 | + | |
436 | 493 | | |
437 | 494 | | |
438 | 495 | | |
| |||
0 commit comments