docs: document ingester WAL truncation mechanics#7661
Open
CharlieTLe wants to merge 1 commit into
Open
Conversation
Add a dedicated blocks-storage/ingester-wal.md page covering the WAL write path, replay on startup, and — most notably — exactly what triggers WAL truncation: the head-compaction loop, the 1.5 x block-ranges-period head-compactable threshold, the head-compaction-idle-timeout forced path, and the lower-two-thirds checkpoint window inside TSDB's truncateWAL. Cross-link the new page from the blocks-storage overview and from the ingester section of production-tips. Signed-off-by: Charlie Le <charlie_le@apple.com>
SungJin1212
reviewed
Jul 2, 2026
| | `-blocks-storage.tsdb.head-compaction-idle-timeout` | `1h` | Forces compaction (and therefore truncation) for tenants whose head is not otherwise compactable. `0` disables. | | ||
| | `-blocks-storage.tsdb.block-ranges-period` | `2h` | Sets both the block size and the `3/2 × block-range` head-compactable threshold. | | ||
| | `-blocks-storage.tsdb.wal-compression-type` | *(none)* | `snappy` or `zstd` reduces WAL size on disk; does not change truncation timing. | | ||
| | `-blocks-storage.tsdb.wal-segment-size-bytes` | TSDB default | Changes the size of each WAL segment; does not change truncation timing. | |
Member
There was a problem hiding this comment.
Could we make this default explicit as 134217728 (TSDB default, 128 MiB) instead of just TSDB default?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/blocks-storage/ingester-wal.md, a dedicated page covering the ingester WAL: write path, replay on startup, and — most notably — exactly what triggers WAL truncation.1.5 × block-ranges-periodhead-compactable threshold, thehead-compaction-idle-timeoutforced-compaction path, and the lower-two-thirds checkpoint window inside TSDB'struncateWAL.docs/blocks-storage/_index.mdand from the Ingester section ofdocs/blocks-storage/production-tips.md.Motivation
The existing docs only state that "the WAL is truncated when a new TSDB block is created, which by default occurs every 2 hours." That is roughly true for busy tenants but leaves several questions unanswered:
head-compaction-idle-timeout.)retention-period)?The new page consolidates that information in one place so operators tuning ingester disk usage don't have to trace through vendored TSDB code.
Test plan
./ingester-wal.md,../guides/ingesters-rolling-updates.md,./production-tips.md#ingester-disk-space.weight: 5,slug: ingester-wal) matches sibling pages underdocs/blocks-storage/.Docs-only change; no code, tests, or config are modified.