Commit d920b9c
committed
fix(qwp): treat all-replica window as transient for durable-ack senders
A durable-ack (request_durable_ack=on) sender that walked an endpoint list
where every reachable node was a REPLICA synthesized a terminal
QwpDurableAckMismatchException (-> PROTOCOL_VIOLATION/HALT) in
QwpWebSocketSender.buildAndConnect. That turned a transient failover window
(a replica can be promoted; a primary will reappear) into a permanent
hard-fail, violating the store-and-forward contract whose only terminal
condition is SF exhaustion. HA senders never recovered even after a replica
was promoted:
server rejected batch: PROTOCOL_VIOLATION - durable-ack-mismatch:
WebSocket upgrade failed: server does not support durable ack [role=REPLICA]
Fix: when a connect round exhausts with only role-rejects, throw the
retriable QwpRoleMismatchException regardless of request_durable_ack. Both
connect paths (connectWithRetry sync, connectLoop async/reconnect) already
retry role-mismatch within reconnect_max_duration_millis, so the sender
keeps rows in SF and recovers on promotion. A genuine capability gap (an
endpoint that upgrades but does not advertise durable ack) stays terminal
via terminalUpgradeError.
BackgroundDrainer: widen its connect-retry catch to the role-reject types so
an orphaned-slot drainer keeps giving the cluster a budget to settle instead
of quarantining on the first all-replica sweep (behaviour unchanged from
when this surfaced as QwpDurableAckMismatchException).1 parent 1570c5a commit d920b9c
2 files changed
Lines changed: 28 additions & 16 deletions
File tree
- core/src/main/java/io/questdb/client/cutlass/qwp/client
- sf/cursor
Lines changed: 17 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2567 | 2567 | | |
2568 | 2568 | | |
2569 | 2569 | | |
2570 | | - | |
2571 | | - | |
2572 | | - | |
2573 | | - | |
2574 | | - | |
2575 | | - | |
2576 | | - | |
2577 | | - | |
2578 | | - | |
2579 | | - | |
2580 | | - | |
2581 | | - | |
2582 | | - | |
2583 | | - | |
2584 | | - | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
2585 | 2587 | | |
2586 | 2588 | | |
2587 | 2589 | | |
| |||
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | | - | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
167 | 177 | | |
168 | 178 | | |
169 | 179 | | |
| |||
0 commit comments