Repository navigation
Wrap legacy --fbin vector index instead of panicking past the end of the file - #192
Open
RaphaelFakhri wants to merge 1 commit into
Open
RaphaelFakhri wants to merge 1 commit into
RaphaelFakhri wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #191
All Submissions:
devbranch. Did you create your branch fromdev?Changes to Core Features:
What this changes
Before this change,
LegacyGenerator::make_pointpassed the point index straight toFBinReader::read_vector. When--num-vectors,--offsetor--max-idgoes past the number of vectors in the--fbinfile, the upload panicked with an out-of-range slice index. The default--num-vectorsis 100000, so any smaller file triggered the panic.The legacy path now takes the index modulo the file's vector count. This matches what
source: {type: file, strategy: from_start}already does for YAML uploads and for query generation.Tests
generators::legacy::tests::fbin_vectors_wrap_past_the_end_of_the_filebuilds a two-vector fbin file and checks points 0, 1, 2 and 5. The test fails ondevwith the out-of-range panic and passes with this change.