Legacy upload with `--fbin` panics when more points are requested than the file holds
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- performance
Research direction
Start from the flag-driven upload path that calls reader.read_vector(idx) on the --fbin reader, and from the YAML from_start source that already applies idx % num_vectors. Check how idx is built from --offset and --max-id. Done when a 1000-vector fbin file with the default --num-vectors uploads without panicking, with indices wrapped the same way as the YAML path.
Written by the indexing model from the issue text.
Description
Description
The flag-driven upload reads the vector for point idx straight from the --fbin file with reader.read_vector(idx). Nothing checks idx against the number of vectors in the file. The value of idx is --offset plus the point's position, or a random value in [--offset, --max-id) when --max-id is set.
So bfb --fbin vectors.fbin with the default --num-vectors 100000 and a file that holds fewer vectors panics partway through the upload:
range end index ... out of range for slice of length ...
The same happens with a large --offset, or with a --max-id larger than the file.
The YAML-config path does not have this problem. source: {type: file, strategy: from_start} wraps the index with idx % num_vectors, and query generation does the same.
Steps to reproduce
- Create an fbin file with 1000 vectors of dimension 128.
- Run
bfb --fbin vectors.fbin --dim 128against a local Qdrant.--num-vectorsdefaults to 100000.
Expected behavior
The upload cycles through the file, as the YAML from_start strategy does.
Actual behavior
The upload panics with an out-of-range slice index once idx reaches the number of vectors in the file.
- Dominant language
- Rust
- Stars
- 22
- Forks
- 5
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from qdrant/bfb
Similar issues
-
autofix:working
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
libracoder/kiri#1138 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
roc-lang/basic-webserver#277 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
samkerrcode/opengent#113 ·
Maintainers usually reply within 1 day
-
app bug session
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day