Commit ac24044
committed
fix(qwp): count a retired slot with stranded data as a recovery deferral
The in-range recovery scan skipped any reserved index as "live" without a
deferral tick. A RETIRED index (wedged close() kept the slot flock) aliases
into that branch: the scan could finish a cycle with zero deferrals and latch
recoveryComplete while the retired slot's dir still held unacked durable
data. From there nothing in-process ever drained it -- reprobeRetiredSlots()
only restores capacity -- so the data waited for a restart or a lucky borrow
of that exact index, which steady low load may never produce.
Treat a retired index whose dir is still a candidate orphan as a deferral,
the same rule as a CONTENDED park: the end-of-scan rewind keeps the cycle
alive, and once the deferred cleanup releases the flock the scan reserves
the freed index and drains it itself -- no borrow required. Data-inert
(durable on disk; a restart already rescanned); this closes the drain-
liveness gap for the life of the pool.
The regression test drives the scan by hand: forge the wedged retire, walk
the scan (pre-fix it latched complete right here), heal the flock, and
assert the scan itself delivers the stranded data and only then completes.1 parent 8722bf1 commit ac24044
2 files changed
Lines changed: 171 additions & 4 deletions
File tree
- core/src
- main/java/io/questdb/client/impl
- test/java/io/questdb/client/test/impl
Lines changed: 53 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
290 | 293 | | |
291 | 294 | | |
292 | 295 | | |
| |||
649 | 652 | | |
650 | 653 | | |
651 | 654 | | |
652 | | - | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
653 | 661 | | |
654 | 662 | | |
655 | 663 | | |
| |||
702 | 710 | | |
703 | 711 | | |
704 | 712 | | |
| 713 | + | |
705 | 714 | | |
706 | 715 | | |
707 | 716 | | |
708 | 717 | | |
709 | 718 | | |
| 719 | + | |
710 | 720 | | |
711 | 721 | | |
712 | 722 | | |
713 | 723 | | |
714 | 724 | | |
715 | 725 | | |
| 726 | + | |
| 727 | + | |
716 | 728 | | |
717 | 729 | | |
718 | 730 | | |
719 | 731 | | |
720 | 732 | | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
721 | 753 | | |
722 | 754 | | |
723 | 755 | | |
724 | | - | |
725 | 756 | | |
726 | 757 | | |
727 | 758 | | |
| |||
868 | 899 | | |
869 | 900 | | |
870 | 901 | | |
871 | | - | |
872 | | - | |
| 902 | + | |
| 903 | + | |
873 | 904 | | |
874 | 905 | | |
875 | 906 | | |
| |||
2073 | 2104 | | |
2074 | 2105 | | |
2075 | 2106 | | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
2076 | 2125 | | |
2077 | 2126 | | |
2078 | 2127 | | |
| |||
Lines changed: 118 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1753 | 1753 | | |
1754 | 1754 | | |
1755 | 1755 | | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
1756 | 1874 | | |
1757 | 1875 | | |
1758 | 1876 | | |
| |||
0 commit comments