vectordotdev / vectordotdev/vector
file-source: support incremental read from files with preallocated size
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
I work with a system that preallocates 4MB file for log and fill it with all zeros.
00014770: 69 74 20 20 20 3A 20 74 72 61 6E 73 61 63 74 69 it...:.transacti
00014780: 6F 6E 20 63 65 6E 74 65 72 20 64 65 6C 65 74 65 on.center.delete
00014790: 64 0D 0A 30 09 31 36 3A 32 33 3A 33 30 2E 30 38 d..0.16:23:30.08
000147a0: 32 09 09 45 78 69 74 20 20 20 3A 20 61 63 74 69 2..Exit...:.acti
000147b0: 76 69 74 79 20 63 65 6E 74 65 72 20 64 65 6C 65 vity.center.dele
000147c0: 74 65 64 0D 0A 00 00 00 00 00 00 00 00 00 00 00 ted.............
000147d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
...
Here you can see last line termination bytes 0D 0A \r\n and then zeros bytes. Now vector tries to read the line of all zeros, discard long line and then don't try to parse the line again.
It would be great to use vector to parse that kind of files.
Contributor 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.
Research direction
No source file or test is named. Start by tracing the file-source entry point and its line-reading behavior for preallocated zero-filled files; done means trailing zero bytes are not treated as a permanently discarded long line and later appended log data is parsed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100