Skip to content

Commit 232dd73

Browse files
oschwaldclaude
andcommitted
Note short-read bug fix in 4.1.0 changelog
The prior multi-chunk MEMORY load loop (introduced in 4.0.0 by 2a1fa7f, "Make buffers read-only for all paths") called FileChannel.read(ByteBuffer) and trusted it to fully fill the destination — a short read would have silently truncated the in-memory database. The new readFully helper retries until each chunk is full, so this is incidentally fixed. Worth noting in the changelog so anyone investigating a >2GB MEMORY-mode corruption can trace it back. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2624387 commit 232dd73

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ CHANGELOG
1212
threads could grow this cache without bound. The reader now uses
1313
`FileInputStream` for `MEMORY` mode, which bypasses the cache.
1414
`FileMode.MEMORY_MAPPED` was unaffected.
15+
* Fixed a latent short-read bug in the multi-chunk `FileMode.MEMORY`
16+
load path introduced in 4.0.0. `FileChannel.read(ByteBuffer)` is not
17+
contractually obligated to fully fill the destination buffer; a
18+
short read could have caused silent truncation of an in-memory
19+
database. Affects databases larger than ~2GB (the default chunk
20+
size). The new chunked read loop retries until each chunk is fully
21+
populated.
1522

1623
4.0.2 (2025-12-08)
1724
------------------

0 commit comments

Comments
 (0)