Commit c6eadf0
committed
fix(qwp): stop close() waiting on acks of uncommitted deferred frames
The server (as of the companion core fix) withholds cumulative OK acks
for FLAG_DEFER_COMMIT frames until their group-closing commit lands:
acking them earlier let the store-and-forward client trim slots whose
rows the server rolls back on any error, demote, or disconnect --
silent data loss (#7144's stated replay contract, previously
unenforced).
Client-side consequences fixed here:
- QwpWebSocketSender tracks lastCommitBoundaryFsn: the FSN of the last
commit-bearing (non-deferred) frame published. Updated by
flushPendingRows, flushPendingRowsSplit, sendCommitMessage, and the
close()-time residual seal.
- drainOnClose() now drains to min(publishedFsn, commit boundary)
instead of publishedFsn. Waiting for acks of an uncommitted deferred
tail could only ever time out (300s hangs in
testDeferredCommitConnectionDropRollsBack). Abandoning frames is
WARN-logged with an actionable message (flush() to commit, or the
abort is intentional).
- CursorSendEngine computes recoveredCommitBoundaryFsn at disk
recovery: the last commit-bearing frame below a potentially orphaned
deferred tail left by a producer that died mid-transaction. Close
drains combine it with the session boundary. Recovery WARNs when an
orphaned deferred tail exists, because replaying it into a NEW
session's commit would resurrect a partial transaction -- the
skip-and-self-ack replay policy for that tail is a documented
follow-up.
- MmapSegment/SegmentRing grow a read-only recovery-time frame walk
(findLastFsnWithoutPayloadFlag) that locates the boundary by peeking
the QWP flags byte of each published frame.
Full client suite passes (2505 tests).1 parent 51bc8af commit c6eadf0
4 files changed
Lines changed: 130 additions & 2 deletions
File tree
- core/src/main/java/io/questdb/client/cutlass/qwp/client
- sf/cursor
Lines changed: 36 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
256 | 263 | | |
257 | 264 | | |
258 | 265 | | |
| |||
1076 | 1083 | | |
1077 | 1084 | | |
1078 | 1085 | | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1079 | 1089 | | |
1080 | 1090 | | |
1081 | 1091 | | |
| |||
3149 | 3159 | | |
3150 | 3160 | | |
3151 | 3161 | | |
3152 | | - | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
3153 | 3178 | | |
3154 | 3179 | | |
3155 | 3180 | | |
| |||
3169 | 3194 | | |
3170 | 3195 | | |
3171 | 3196 | | |
3172 | | - | |
| 3197 | + | |
3173 | 3198 | | |
3174 | 3199 | | |
3175 | 3200 | | |
| |||
3430 | 3455 | | |
3431 | 3456 | | |
3432 | 3457 | | |
| 3458 | + | |
| 3459 | + | |
| 3460 | + | |
3433 | 3461 | | |
3434 | 3462 | | |
3435 | 3463 | | |
| |||
3502 | 3530 | | |
3503 | 3531 | | |
3504 | 3532 | | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
3505 | 3538 | | |
3506 | 3539 | | |
3507 | 3540 | | |
| |||
3543 | 3576 | | |
3544 | 3577 | | |
3545 | 3578 | | |
| 3579 | + | |
3546 | 3580 | | |
3547 | 3581 | | |
3548 | 3582 | | |
| |||
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
260 | 268 | | |
261 | 269 | | |
262 | 270 | | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
263 | 294 | | |
264 | 295 | | |
265 | 296 | | |
| |||
600 | 631 | | |
601 | 632 | | |
602 | 633 | | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
603 | 644 | | |
604 | 645 | | |
605 | 646 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
446 | 474 | | |
447 | 475 | | |
448 | 476 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
513 | 538 | | |
514 | 539 | | |
515 | 540 | | |
| |||
0 commit comments