fix(qwp): drop cached timestamp columns and repair accounting on buffer clear/rollback - #77
fix(qwp): drop cached timestamp columns and repair accounting on buffer clear/rollback#77jerrinot wants to merge 3 commits into
Conversation
…er clear/rollback Senders cache designated-timestamp ColumnBuffer refs and derive bookkeeping from their table buffers. rollbackUncommittedColumns() (failed at()) and QwpTableBuffer.clear() close those columns, leaving dangling refs that NPE on the next at() and corrupt pending accounting. - Invalidate WebSocket timestamp caches in rollbackRow(); cancelRow() now routes through it. - Add QwpTableBuffer.Owner: clear() notifies the owning sender before releasing columns. WebSocket subtracts the buffer's exact accounted share (committedBytes - new baselineBytes, seed offsets excluded); UDP resets transient row state, datagram estimate, and headroom state (its base-estimate cache is keyed by column count alone). - Unify flush snapshot anchoring at post-reset storage so per-table contributions are exact under any reset/switch/flush history. Hot path unchanged. Regressions: clear between rows (both units, both senders), non-current/mid-row clear, accounting locality, stale headroom estimate.
|
All four review agents plus my own trace converge: no correctness, concurrency, resource, performance, or accounting defect. The fresh-context adversarial agent independently ran the suites (108 tests) plus a custom probe of the one untested path and found nothing. Here is the verified report. Review: PR #77 —
|
Track the bounded creation wait and handled interrupts in one atomic test witness. Handshake repeated interrupts until the original wait exits so the regression tests reject deadline resets without depending on scheduler timing.
Exercise current-buffer clear with committed and in-progress rows so cached timestamps and pending counters must be repaired. Add a real flush regression that excludes retained var-width seed bytes from subsequent pending-byte accounting.
[PR Coverage check]😍 pass : 71 / 72 (98.61%) file detail
|
A QWP/WebSocket sender could become unusable after rejecting an oversized row that introduced the table’s designated timestamp column. The rollback removed the column, but the sender kept a cached reference to it, so the next timestamped row failed with a
NullPointerException.The sender now discards cached timestamp state when a row is rolled back, allowing ingestion to continue after an oversized-row error. Clearing a sender-owned
QwpTableBufferthrough the test-only accessors now performs equivalent cleanup and reconciles WebSocket row/byte accounting and UDP datagram-size estimates, so the buffer can be reused safely.