Commit 2c9924d
Reject timestamp name set while rows are buffered
QwpTableBuffer.setDesignatedTimestampName guarded only the rename
branch on rowCount, so a first set was accepted with rows already
buffered. On the UDP sender, TableOptionsImpl.designatedTimestamp
then bumped committedDatagramEstimate by the trailer size without
flushing or re-checking the cap. Since only commitCurrentRow checks
maxDatagramSize, a subsequent flush() shipped a datagram exceeding
the configured cap: IP fragmentation, or EMSGSIZE and silent data
loss near the 65507-byte limit.
setDesignatedTimestampName now rejects a first set while the buffer
holds rows, symmetric with the rename guard. This makes the estimate
bump in TableOptionsImpl unreachable, so this commit deletes it and
keeps only the base-estimate invalidation. Javadocs on QwpTableBuffer
and Sender.TableOptions now state the name may be set or re-declared
only while the table has no buffered rows.
Regression tests cover the buffer-level throw and the sender-level
scenario: the late set throws, the flushed datagram carries no
table-options trailer, and all packets stay within maxDatagramSize.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 7a81add commit 2c9924d
5 files changed
Lines changed: 62 additions & 14 deletions
File tree
- core/src
- main/java/io/questdb/client
- cutlass/qwp
- client
- protocol
- test/java/io/questdb/client/test/cutlass/qwp
- client
- protocol
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
870 | 870 | | |
871 | 871 | | |
872 | 872 | | |
873 | | - | |
874 | | - | |
875 | | - | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| |||
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1548 | 1548 | | |
1549 | 1549 | | |
1550 | 1550 | | |
1551 | | - | |
1552 | 1551 | | |
1553 | 1552 | | |
1554 | | - | |
1555 | | - | |
1556 | | - | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
1557 | 1556 | | |
1558 | 1557 | | |
1559 | 1558 | | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | 1559 | | |
1566 | 1560 | | |
1567 | 1561 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
| 369 | + | |
| 370 | + | |
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
386 | 392 | | |
387 | 393 | | |
388 | 394 | | |
| |||
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1729 | 1729 | | |
1730 | 1730 | | |
1731 | 1731 | | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
1732 | 1759 | | |
1733 | 1760 | | |
1734 | 1761 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1371 | 1371 | | |
1372 | 1372 | | |
1373 | 1373 | | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1374 | 1395 | | |
1375 | 1396 | | |
1376 | 1397 | | |
| |||
0 commit comments