Repository navigation
Description
internal/config.WriteBufferConfig declares three resource limits that reach no consumer:
| field | declared | defaulted | validated | read by a consumer |
|---|---|---|---|---|
write_buffer.flush_interval |
config.go:129 |
:506 (30s) |
:1195 |
no |
write_buffer.max_buffers |
config.go:130 |
:507 (1000) |
— | no |
write_buffer.max_memory |
config.go:131 |
:508 ("512MB") |
:1113 |
no |
Worse than the usual inert-setting case, because these are validated. max_memory is parsed and range-checked at :1113, so a user who writes max_memory: 2GB gets it accepted, confirmed by validation, and then ignored. Validation is the strongest signal a config system can send that a setting is real.
How they got stranded, which decides the fix: v0.10.1 replaced the contiguous write buffer with internal/vfs dirty-range tracking. The old WriteBuffer these fields configured is gone; the new write path has its own memory behavior and no equivalent knob. So this is not "wire the field to the old consumer" — the consumer no longer exists, and the question is what bounds the new path.
That question is worth answering rather than deleting the fields: internal/vfs dirty ranges are currently unbounded. A process writing sparse ranges across many files accumulates dirty state with no cap and no backpressure, which on a filesystem is how a mount takes the machine down rather than returning ENOSPC. max_memory is the setting that should bound it.
Do:
- Establish what bounds dirty-range memory in
internal/vfs, and what happens at the bound — flush early, block the writer, orENOSPC. That is a semantics decision, not a plumbing one. - Wire
max_memoryto it, andflush_intervalto whatever periodic flush the new path has (or should have — writeback with no timer means data sits dirty indefinitely on an idle file). max_buffersmay have no meaning in a range-based design; if so, delete it rather than inventing one, and say why in the changelog since it is a documented key.
Verification: write past max_memory and assert the configured behavior happens — measured against actual process RSS or the vfs's own accounting, not a counter the test also computes. Related: #193 (harness memory footprint) is the test-side of the same unboundedness.
Activity
scttfrdmn commentedon Aug 3, 2026
Confirmed live and first in v0.11.0's write-path phase.
write_buffer.max_memoryis declared (internal/config/config.go:131), defaulted to"512MB"(:508), and validated as a size string (:1113) — andgrep -rn MaxMemory --include='*.go' . | grep -v _test.goreturns only those three config.go lines. Nothing ininternal/vfsreads it, and there is noMaxDirty/MaxBufferSizeequivalent either.So the v0.10.3 dirty-range write path buffers without any bound: a large sparse write pattern grows the interval map until flush with nothing to stop it, while the configuration reports a 512MB limit. This is the same shape as the defects the v0.10.x releases were spent on — a value that claims a property no code enforces — and it is on the write path, so it goes before the cosmetic config fixes.
fix: a single file can grow past the write buffer's memory bound
fix: compression is configured where the compression happens (#244)