Commit be6a0d1
authored
[automatic-failover] Integrate health checks with probing policies and retry logic (CAE-1685) (#3541)
* initial port Jedis health monitoring
* wip integrate healthchecks
* formating
* formating
* add test case plan
* Endpoints without health checks configured should return HEALTHY
Changes
- add connection.getHealthStatus(RedisUri endpoint)
- HEALTHY - returned for Databases without health checks configured
- add test
* Create MultiDbClient with custom health check strategy supplier
Changes
- add test to ensure health status changes from custom health checks are reflected
* Create MultiDbClient with custom health check strategy supplier
Changes
- add test to ensure health status changes from custom health checks are reflected
* faster await timeout
* add test - use different health check strategies for different endpoints
* wait for initial healthy database
* add test - configure health check interval and timeout
* add test - trigger failover when health check detects unhealthy endpoint
* add test - should not failover to unhealthy endpoints
* add test - Should trigger failover via circuit breaker even when health check returns HEALTHY
* reduce await poll interval in HealthCheckIntegrationTest
* mark un-implemented tests are disabled
* add test - Should transition from UNKNOWN to HEALTHY
* add test - Should create health check when adding new database
* fix - Should stop health check when removing database
* add test - Should stop health check when removing database
* add test - HealthCheckLifecycleTests
- Should start health checks automatically when connection is created
- Should stop health checks when connection is closed
* fix HealthCheck not stopped on StatefulRedisMultiDbConnection.close()
* remove HealthStatusListenerTests stubs, health check events, not exposed publicly
* format
* add health checks unit test
* clean up
- rename health check thread names to lettuce-*
- clean up warnings
- format
- javadocs & autor updated
* address failing tests
- Update StatefulMultiDbConnectionIntegrationTests to account for added additional test server in MultiDbTestSupport
- Junit4 @after replaced with JUnit5
* address failing tests
- Update StatefulMultiDbConnectionIntegrationTests to account for added additional test server in MultiDbTestSupport
- Junit4 @after replaced with JUnit5
* package private StatusTracker
* make healthStatusManager required when creating MultiDbStatefullConnection
* remove un-implemented probing integration tests
- covered with unit tests
* introduce isHealthy() to replace getHealthStatus()
* register listeners before adding HealthChecks1 parent 5f3060f commit be6a0d1
File tree
29 files changed
+3181
-44
lines changed- src
- main/java/io/lettuce/core/failover
- api
- health
- test/java/io/lettuce/core/failover
- health
29 files changed
+3181
-44
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
Lines changed: 46 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | | - | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
41 | 60 | | |
42 | 61 | | |
43 | 62 | | |
44 | | - | |
| 63 | + | |
45 | 64 | | |
46 | 65 | | |
47 | 66 | | |
48 | 67 | | |
49 | 68 | | |
50 | 69 | | |
51 | | - | |
| 70 | + | |
52 | 71 | | |
53 | 72 | | |
54 | 73 | | |
55 | | - | |
| 74 | + | |
56 | 75 | | |
57 | 76 | | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
61 | | - | |
| 80 | + | |
62 | 81 | | |
63 | 82 | | |
64 | 83 | | |
| |||
97 | 116 | | |
98 | 117 | | |
99 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
100 | 128 | | |
101 | 129 | | |
102 | 130 | | |
| |||
110 | 138 | | |
111 | 139 | | |
112 | 140 | | |
113 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
114 | 148 | | |
115 | 149 | | |
116 | 150 | | |
117 | 151 | | |
118 | 152 | | |
119 | 153 | | |
120 | 154 | | |
| 155 | + | |
| 156 | + | |
121 | 157 | | |
122 | 158 | | |
123 | 159 | | |
124 | 160 | | |
125 | 161 | | |
126 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
127 | 165 | | |
128 | 166 | | |
129 | 167 | | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | | - | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
Lines changed: 108 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
16 | 25 | | |
17 | 26 | | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
22 | 33 | | |
23 | 34 | | |
| |||
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
| 44 | + | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| |||
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| 89 | + | |
| 90 | + | |
76 | 91 | | |
77 | 92 | | |
78 | 93 | | |
| |||
81 | 96 | | |
82 | 97 | | |
83 | 98 | | |
84 | | - | |
| 99 | + | |
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
89 | 108 | | |
90 | 109 | | |
91 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
92 | 115 | | |
93 | 116 | | |
94 | 117 | | |
95 | | - | |
| 118 | + | |
96 | 119 | | |
97 | 120 | | |
98 | 121 | | |
99 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
100 | 134 | | |
101 | 135 | | |
102 | 136 | | |
| |||
116 | 150 | | |
117 | 151 | | |
118 | 152 | | |
| 153 | + | |
| 154 | + | |
119 | 155 | | |
120 | 156 | | |
121 | 157 | | |
122 | 158 | | |
123 | 159 | | |
124 | 160 | | |
125 | | - | |
| 161 | + | |
| 162 | + | |
126 | 163 | | |
127 | 164 | | |
128 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
129 | 170 | | |
130 | 171 | | |
131 | | - | |
| 172 | + | |
132 | 173 | | |
133 | 174 | | |
134 | 175 | | |
135 | | - | |
| 176 | + | |
136 | 177 | | |
137 | 178 | | |
138 | 179 | | |
139 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
140 | 192 | | |
141 | 193 | | |
142 | 194 | | |
| |||
158 | 210 | | |
159 | 211 | | |
160 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
161 | 261 | | |
0 commit comments