Commit 51bc8af
committed
fix(client): role-reject evidence outranks latched non-421 upgrade error in mixed connect sweep
In a mixed sweep -- e.g. [replica(421+role), replica(421+role),
node(503)] -- the exhausted-round epilogue threw the latched non-421
WebSocketUpgradeException before checking lastRoleReject, misclassifying
a transient failover/promotion window as terminal: dead foreground
sender, or a drainer slot quarantine via BackgroundDrainer markFailed.
Demote a plain non-421 WebSocketUpgradeException below role-reject
evidence: when any endpoint answered 421+role in the same sweep, surface
the retriable QwpRoleMismatchException so the connect/reconnect loops
keep rows in store-and-forward and retry through the promotion window.
The demoted upgrade error rides along as a suppressed diagnostic.
Typed capability gaps are NOT demoted: QwpVersionMismatchException and
QwpDurableAckMismatchException extend HttpClientException directly, so
they fall through the instanceof check and stay terminal even when
replicas role-rejected in the same sweep -- preserving the documented
durable-ack contract.
Covered by WriteFailoverTest#testMixedSweepRoleRejectOutranksLatchedTerminalUpgradeError,
which also asserts the suppressed 503 diagnostic.1 parent 70adbf1 commit 51bc8af
2 files changed
Lines changed: 113 additions & 8 deletions
File tree
- core/src
- main/java/io/questdb/client/cutlass/qwp/client
- test/java/io/questdb/client/test/cutlass/qwp/client
Lines changed: 35 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2761 | 2761 | | |
2762 | 2762 | | |
2763 | 2763 | | |
2764 | | - | |
2765 | | - | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
2766 | 2771 | | |
2767 | 2772 | | |
2768 | 2773 | | |
| |||
2963 | 2968 | | |
2964 | 2969 | | |
2965 | 2970 | | |
2966 | | - | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
2967 | 2987 | | |
2968 | 2988 | | |
2969 | 2989 | | |
2970 | | - | |
2971 | | - | |
2972 | | - | |
2973 | | - | |
2974 | | - | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
| 2994 | + | |
| 2995 | + | |
| 2996 | + | |
2975 | 2997 | | |
2976 | 2998 | | |
2977 | 2999 | | |
| |||
2993 | 3015 | | |
2994 | 3016 | | |
2995 | 3017 | | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
2996 | 3023 | | |
2997 | 3024 | | |
2998 | 3025 | | |
| |||
Lines changed: 78 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
309 | 387 | | |
310 | 388 | | |
311 | 389 | | |
| |||
0 commit comments