Commit eb69228
committed
Bugfix: don't roll back the whole scan batch on one duplicate name
- `insert_entries_v2_batch` used plain `INSERT` inside a savepoint, so a single `(parent_id, name_folded)` collision (case-sensitive volumes with `Foo.txt`/`foo.txt` siblings, NFC/NFD twins from cross-OS sync, etc.) rolled back the entire 2000-entry batch — silently dropping 1999 unrelated rows plus orphaning every descendant whose `parent_id` was allocated from that batch.
- Switch to `INSERT OR IGNORE` and return a `Vec<bool>` parallel to the input so the caller can tell which rows actually landed.
- `handle_insert_entries_v2` filters the accumulator input by that vec, so the in-memory aggregation state still satisfies "never claim more than the DB has" (the constraint that protects against the historical 1.83 TB ghost size on `..`).
- Log conflicts at WARN with a sample of `(parent_id, name)` pairs so the offending filesystem is diagnosable.
- `accumulate` now takes `impl IntoIterator<Item = &EntryRow>` so the filtered-iteration path doesn't need an extra clone.
- Update the existing accumulator-consistency test to assert the new per-row behavior; rename it to `handle_insert_entries_v2_only_accumulates_rows_that_landed`. Replace the old "duplicate rejected" store test with one that verifies graceful skip + survivors land.
- Update `indexing/CLAUDE.md` gotchas to reflect the new contract.1 parent 9e80891 commit eb69228
3 files changed
Lines changed: 122 additions & 55 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
868 | 868 | | |
869 | 869 | | |
870 | 870 | | |
871 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
872 | 881 | | |
873 | | - | |
| 882 | + | |
874 | 883 | | |
875 | 884 | | |
876 | | - | |
877 | | - | |
878 | | - | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
879 | 890 | | |
880 | | - | |
| 891 | + | |
881 | 892 | | |
882 | 893 | | |
| 894 | + | |
883 | 895 | | |
884 | 896 | | |
885 | | - | |
| 897 | + | |
886 | 898 | | |
887 | 899 | | |
888 | 900 | | |
| |||
894 | 906 | | |
895 | 907 | | |
896 | 908 | | |
| 909 | + | |
897 | 910 | | |
898 | | - | |
| 911 | + | |
899 | 912 | | |
900 | 913 | | |
901 | 914 | | |
| |||
2049 | 2062 | | |
2050 | 2063 | | |
2051 | 2064 | | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
2052 | 2072 | | |
2053 | | - | |
| 2073 | + | |
2054 | 2074 | | |
2055 | 2075 | | |
2056 | 2076 | | |
| |||
2073 | 2093 | | |
2074 | 2094 | | |
2075 | 2095 | | |
2076 | | - | |
2077 | | - | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2078 | 2109 | | |
2079 | 2110 | | |
2080 | 2111 | | |
2081 | 2112 | | |
2082 | | - | |
2083 | | - | |
2084 | | - | |
2085 | | - | |
2086 | | - | |
| 2113 | + | |
| 2114 | + | |
2087 | 2115 | | |
2088 | | - | |
2089 | | - | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
2090 | 2119 | | |
| 2120 | + | |
2091 | 2121 | | |
2092 | 2122 | | |
2093 | 2123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
472 | | - | |
473 | | - | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
474 | 475 | | |
| 476 | + | |
475 | 477 | | |
476 | 478 | | |
477 | 479 | | |
| |||
817 | 819 | | |
818 | 820 | | |
819 | 821 | | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
826 | 831 | | |
827 | | - | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
828 | 861 | | |
829 | 862 | | |
830 | 863 | | |
| |||
1642 | 1675 | | |
1643 | 1676 | | |
1644 | 1677 | | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
1651 | 1684 | | |
1652 | | - | |
| 1685 | + | |
1653 | 1686 | | |
1654 | 1687 | | |
1655 | 1688 | | |
1656 | 1689 | | |
1657 | 1690 | | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
| 1691 | + | |
1661 | 1692 | | |
1662 | 1693 | | |
1663 | 1694 | | |
| |||
1671 | 1702 | | |
1672 | 1703 | | |
1673 | 1704 | | |
1674 | | - | |
1675 | | - | |
| 1705 | + | |
| 1706 | + | |
1676 | 1707 | | |
1677 | 1708 | | |
1678 | | - | |
| 1709 | + | |
1679 | 1710 | | |
1680 | 1711 | | |
1681 | 1712 | | |
1682 | 1713 | | |
1683 | | - | |
1684 | | - | |
| 1714 | + | |
| 1715 | + | |
1685 | 1716 | | |
1686 | 1717 | | |
1687 | 1718 | | |
| |||
1711 | 1742 | | |
1712 | 1743 | | |
1713 | 1744 | | |
1714 | | - | |
| 1745 | + | |
| 1746 | + | |
1715 | 1747 | | |
1716 | 1748 | | |
1717 | 1749 | | |
1718 | 1750 | | |
1719 | | - | |
1720 | | - | |
1721 | | - | |
1722 | 1751 | | |
1723 | | - | |
1724 | | - | |
| 1752 | + | |
| 1753 | + | |
1725 | 1754 | | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
1729 | | - | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
1730 | 1763 | | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
1731 | 1768 | | |
1732 | 1769 | | |
1733 | 1770 | | |
| |||
0 commit comments