-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG FIX] Fix knn index shard to get bwc engine paths #309
Conversation
Fixes getEnginePaths in KNNIndexShard to retrieve all engine paths, regardless of what version the index was created. Prevents silent failure when warmup completes but doesnt load any segments. Signed-off-by: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks.
Some checks seem to be failing. You may want to fix it.
protected Map<String, SpaceType> getEnginePaths(Collection<String> files, String segmentName, String fieldName, | ||
String fileExtension, Path shardPath, SpaceType spaceType) { | ||
return files.stream() | ||
.filter(fileName -> fileName.startsWith(buildEngineFilePrefix(segmentName))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have to compute buildEngineFilePrefix for every file. This can be called once outside streams and used inside filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Updated.
Right. Its checkstyle. I was going to get review first before fixing it, as to not clutter the diff. |
Signed-off-by: John Mazanec <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
Signed-off-by: John Mazanec <[email protected]>
d0d96ca
Fixes getEnginePaths in KNNIndexShard to retrieve all engine paths, regardless of what version the index was created. Prevents silent failure when warmup completes but doesnt load any segments. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit bb28393)
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.2 1.2
# Navigate to the new working tree
cd .worktrees/backport-1.2
# Create a new branch
git switch --create backport/backport-309-to-1.2
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 bb283932b5834172142d18188668db8fa31676d6
# Push it to GitHub
git push --set-upstream origin backport/backport-309-to-1.2
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.2 Then, create a pull request where the |
…ject#309) Fixes getEnginePaths in KNNIndexShard to retrieve all engine paths, regardless of what version the index was created. Prevents silent failure when warmup completes but doesnt load any segments. Signed-off-by: John Mazanec <[email protected]>
Description
Fixes getEnginePaths in KNNIndexShard to retrieve all engine paths, regardless of what version the index was created. Prevents silent failure when warmup completes but doesnt load any segments.
Instead of checking if the engine file that the current version of the plugin would create is in the segment, it just checks the prefix and suffix of the file that would be created. To prevent this failure in the future, a new test was added. Intentionally, the structure is hardcoded. This will ensure that this will be caught in the future if segment file naming conventions change.
Issues Resolved
#308
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.