Commit 45ed375
fix(search): keep unfiltered function pages in stable id order (#17)
* Avoid Lua full-set reads for unfiltered function lists
* fix(search): keep unfiltered function pages in stable id order
The unfiltered function-list path added in #13 paged straight off SSCAN,
which has no stable ordering. Consecutive pages could overlap or skip
rows, and the same request could return a different page each time —
the old Lua path sorted by id ascending.
There is no id-ordered index to range over (save_function only does
SADD on {col}:all_functions), so bound the scan instead: collect up to
SORT_SCAN_CAP members, sort by id, slice the page, and report anything
beyond the cap via the existing pool_truncated flag. The scan stays
incremental, so it never holds Kvrocks the way the SMEMBERS-in-Lua path
did.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(search): keep unfiltered function pages in stable id order
The unfiltered function-list path added in #13 paged straight off SSCAN,
which has no stable ordering. Consecutive pages could overlap or skip
rows, and the same request could return a different page each time — the
old Lua path sorted by id ascending.
Use the same shape as the unfiltered paths in search_file and
search_feature: load the set, sort in Python, slice. The hang in #12 came
from doing this inside Lua under the Kvrocks global EVAL lock, which #13
already removed; from Python the sibling routes have done it this way all
along.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: SegmondFault <izaakalfredgray@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent bcb7fb0 commit 45ed375
1 file changed
Lines changed: 17 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
| |||
464 | 461 | | |
465 | 462 | | |
466 | 463 | | |
467 | | - | |
| 464 | + | |
468 | 465 | | |
469 | | - | |
| 466 | + | |
470 | 467 | | |
471 | 468 | | |
472 | 469 | | |
| |||
0 commit comments