Commit a2af8e6
committed
fix(index): clear the legacy embeddings table on reset and deindex
reset()'s docstring warns "leaving stale rows here means semantic
search can return orphaned hits after a reindex" and deindex()'s
docstring promises to remove "the embedding row for any kind," but
neither ever touched the legacy embeddings table alongside
embedding_index. every artifact deletion or full reindex leaked a
stale vector row that never gets cleaned up.
search_embeddings (plural, the reader of the legacy table) currently
has no callers in src/, so this isn't live search pollution today -
but health._check_orphan_embeddings explicitly checks both tables, so
a leaked row permanently trips the orphan_embedding fsck warning with
no way to clear it via the documented remedy (reindexing), and grows
state.db unbounded over a kb's lifetime.
add the missing DELETE FROM embeddings to reset()'s executescript, and
the missing per-row delete to deindex(), matching the existing
embedding_index handling in both.
this exact defect and fix were previously submitted as #543
(fix(index): clear the legacy embeddings table on reset and deindex),
but that PR was closed unmerged for going stale against a fast-moving
test branch, not for anything wrong with the change; the maintainer's
closing comment explicitly invited a fresh PR.
Fixes #6871 parent 5534a11 commit a2af8e6
3 files changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
205 | 209 | | |
206 | 210 | | |
207 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
213 | 241 | | |
214 | 242 | | |
215 | 243 | | |
| |||
0 commit comments