Fix SkipTo edge case - [MOD-8561 MOD-8673]#5591
Conversation
|
|
||
| idx->numDocs -= info->ndocsCollected; | ||
| idx->gcMarker++; | ||
| idx->lastId = idx->blocks[idx->size - 1].lastId; // Update lastId |
There was a problem hiding this comment.
isn't it possible idx->size is zero?
There was a problem hiding this comment.
Nope. If we delete all the blocks, we add an empty one.
Yet, I can add a validation here
There was a problem hiding this comment.
I think let's have an assertion, max
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5591 +/- ##
=======================================
Coverage 87.27% 87.27%
=======================================
Files 196 196
Lines 35285 35288 +3
=======================================
+ Hits 30795 30798 +3
Misses 4490 4490 ☔ View full report in Codecov by Sentry. |
|
|
||
| idx->numDocs -= info->ndocsCollected; | ||
| idx->gcMarker++; | ||
| idx->lastId = idx->blocks[idx->size - 1].lastId; // Update lastId |
There was a problem hiding this comment.
I think let's have an assertion, max
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.8
git worktree add -d .worktree/backport-5591-to-2.8 origin/2.8
cd .worktree/backport-5591-to-2.8
git switch --create backport-5591-to-2.8
git cherry-pick -x c29e9bccd5136fec493245810e316fb9b8da4cdf |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.6
git worktree add -d .worktree/backport-5591-to-2.6 origin/2.6
cd .worktree/backport-5591-to-2.6
git switch --create backport-5591-to-2.6
git cherry-pick -x c29e9bccd5136fec493245810e316fb9b8da4cdf |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.10
git worktree add -d .worktree/backport-5591-to-2.10 origin/2.10
cd .worktree/backport-5591-to-2.10
git switch --create backport-5591-to-2.10
git cherry-pick -x c29e9bccd5136fec493245810e316fb9b8da4cdf |
* add a failing test * add an assertion * fix the bug * add another assertion * add another scenario * add an assertion to the gc * rename test * simplified test * simplified simplification (cherry picked from commit c29e9bc)
|
Successfully created backport PR for |
Fix SkipTo edge case - [MOD-8561 MOD-8673] (#5591) * add a failing test * add an assertion * fix the bug * add another assertion * add another scenario * add an assertion to the gc * rename test * simplified test * simplified simplification (cherry picked from commit c29e9bc) Co-authored-by: GuyAv46 <[email protected]>
* add a failing test * add an assertion * fix the bug * add another assertion * add another scenario * add an assertion to the gc * rename test * simplified test * simplified simplification (cherry picked from commit c29e9bc)
* add a failing test * add an assertion * fix the bug * add another assertion * add another scenario * add an assertion to the gc * rename test * simplified test * simplified simplification (cherry picked from commit c29e9bc)
* add a failing test * add an assertion * fix the bug * add another assertion * add another scenario * add an assertion to the gc * rename test * simplified test * simplified simplification (cherry picked from commit c29e9bc)
Describe the changes in the pull request
Fix a bug in the GC, which should update the last ID of an inverted index when cleaning it, in case it was modified.
This last ID in the index is used in the inverted-index reader iterator to test if we can expect more results from this iterator quickly.
An edge case where the last id(s) were deleted and this value was not up-to-date could cause the index reader iterator to assume it has a block to skip to, while that's not the case, causing unsafe access to the end of the block array.
Which additional issues this PR fixes
Main objects this PR modified
Mark if applicable