Repository navigation
Commit 021f49f
committed
ADFA-5094: fix subtree truncation correctness (review follow-up)
Two size-under-count bugs in buildLocalSubtree, both only reachable when a subtree exceeds
the node cap:
- The files subquery had an ORDER-BY-less LIMIT, so under truncation it could select a
different node subset than the rows query and leave a built node without its files. Drop
the LIMIT: the subquery now covers every kept node; files for nodes past the cap are just
never looked up.
- Truncation marked only the root incomplete, so deeper truncated folders under-counted
silently. Mark every node whose range extends past the cutoff (rght > last kept lft) as
incomplete, so the mapper reports unknown size instead of under-counting. Over-marking is
safe; under-marking was the bug.
Subtrees within the cap are unaffected: no truncation, complete children, exact sizes.1 parent baacf0e commit 021f49f
1 file changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
300 | 304 | | |
301 | 305 | | |
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
305 | 309 | | |
306 | 310 | | |
307 | | - | |
308 | | - | |
| 311 | + | |
| 312 | + | |
309 | 313 | | |
310 | 314 | | |
311 | 315 | | |
| |||
333 | 337 | | |
334 | 338 | | |
335 | 339 | | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
340 | 351 | | |
341 | 352 | | |
342 | 353 | | |
| |||
0 commit comments