Commit f9ece1a
committed
fix(qwp): orphan drainer retries a down server instead of quarantining (Invariant B)
connectWithDurableAckRetry() routed every non-role, non-durable-ack Throwable
-- including "all endpoints unreachable" (server down / network partition) --
to an IMMEDIATE markFailed / .failed sentinel on the first sweep. That
quarantined an orphan slot's un-drained SF data on a transient outage, needing
manual recovery, and was asymmetric with the live sender's background loop
(CursorWebSocketSendLoop.connectLoop, which retries transport errors forever).
It was worst exactly under lazy_connect=true (server down at startup is the
whole point), where it quarantined all orphan data on boot.
Make the drainer classify failures exactly like connectLoop:
- NEW catch (QwpAuthFailedException | WebSocketUpgradeException) -> terminal,
quarantine immediately (genuinely non-retriable across the cluster).
- catch (Throwable) -> TRANSIENT: back off (capped exponential) and retry
indefinitely until a primary is reachable, stopRequested, or SF exhaustion;
never quarantine. WARN throttled to 1/5s so a long/permanent outage stays
observable without flooding.
- Role reject (all-replica) keeps retry-forever; durable-ack capability gap
keeps its bounded settle budget (the one deliberate rolling-upgrade tolerance).
Tests:
- testTransportErrorNeverQuarantinesInvariantB: now green (down server retried).
- testNonDurableAckExceptionMarksFailedImmediately -> testTerminalUpgrade
MarksFailedImmediately: repurposed to a genuine upgrade terminal, since a
transport error is now retryable. 49 drainer/pool tests pass.1 parent a8fea31 commit f9ece1a
2 files changed
Lines changed: 39 additions & 11 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass/qwp/client/sf/cursor
- test/java/io/questdb/client/test/cutlass/qwp/client/sf/cursor
Lines changed: 29 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
| 177 | + | |
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| |||
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
184 | 198 | | |
185 | 199 | | |
186 | 200 | | |
| |||
248 | 262 | | |
249 | 263 | | |
250 | 264 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
257 | 280 | | |
258 | 281 | | |
259 | 282 | | |
| |||
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
216 | 221 | | |
217 | | - | |
| 222 | + | |
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
| |||
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
226 | | - | |
| 231 | + | |
227 | 232 | | |
228 | 233 | | |
229 | | - | |
| 234 | + | |
230 | 235 | | |
231 | 236 | | |
232 | 237 | | |
| |||
0 commit comments