Files
milvus/internal
yihao.daiandGitHub 96f05a0dd8 fix: recover import reader from premature EOF (#49648)
## Summary

Fixes #49645

Bulk import can hit `unexpected EOF` when a remote object stream stays
idle during function execution and the object-store reader returns a
premature EOF. This PR makes sequential import readers recover by
reopening the object reader at the last successful offset when EOF
happens before the known object size.

## Changes

- Add reopen-and-retry support to `RetryableReader` for retryable read
errors and premature EOF.
- Use `ChunkManager.Size` as a fallback object-size source for readers
whose `Size()` is lazy or unreliable before reading.
- Return unexpected EOF, not clean EOF, when premature EOF retries are
exhausted.
- Enable the reopen path for JSON, CSV, and Numpy import readers.
- Keep Parquet unchanged because Arrow uses `ReadAt`/`Seek`, which this
sequential wrapper does not cover.

## Test Plan

- [x] `make static-check`
- [x] `git diff --check`
- [x] `go test ./internal/util/importutilv2/common
./internal/util/importutilv2/json ./internal/util/importutilv2/csv
./internal/util/importutilv2/numpy ./internal/util/importutilv2/parquet
-count=1 -ldflags="-r ${RPATH}"`

---------

Signed-off-by: Yihao Dai <yihao.dai@zilliz.com>
2026-05-18 09:22:29 +08:00
..