Skip to content

enhancement: enable async parquet read mode for WAL completion path#6967

Merged
zhxiaogg merged 7 commits intografana:mainfrom
zhxiaogg:worktree-async-io-when-completing-wal
Apr 16, 2026
Merged

enhancement: enable async parquet read mode for WAL completion path#6967
zhxiaogg merged 7 commits intografana:mainfrom
zhxiaogg:worktree-async-io-when-completing-wal

Conversation

@zhxiaogg
Copy link
Copy Markdown
Contributor

@zhxiaogg zhxiaogg commented Apr 14, 2026

What this PR does:

  • Enabled parquet ReadModeAsync when opening WAL files during block completion. This allows parquet-go to issue concurrent ReadAt calls, improving I/O throughput. OS page cache handles buffering for local disk so no userspace BufferedReaderAt is needed.

Based on the test result, we saw slightly improvements on the WAL completion duration. Didn't find major issues with cpu/meme/query etc.

Which issue(s) this PR fixes:
Fixes N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Add TEMPO_WAL_ASYNC_IO env var to gate enabling parquet ReadModeAsync
when opening WAL files during block completion. This allows parquet-go
to issue concurrent ReadAt calls, improving I/O throughput. OS page
cache handles buffering for local disk so no userspace BufferedReaderAt
is needed.
Copilot AI review requested due to automatic review settings April 14, 2026 18:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an opt-in async parquet read mode for WAL block completion by gating parquet.ReadModeAsync behind a new TEMPO_WAL_ASYNC_IO environment variable in the vParquet4/vParquet5 WAL open path.

Changes:

  • Add TEMPO_WAL_ASYNC_IO env var constant to vParquet4/vParquet5 packages.
  • When the env var is set, open WAL parquet files with parquet.FileReadMode(parquet.ReadModeAsync) during block completion.
  • Add iterator tests that exercise the WAL iterator with async IO enabled (vParquet4/vParquet5).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tempodb/encoding/vparquet5/wal_block.go Gate parquet async read mode for WAL parquet file opens via env var.
tempodb/encoding/vparquet4/wal_block.go Same async read mode gating for vParquet4 WAL file opens.
tempodb/encoding/vparquet5/block_findtracebyid.go Define EnvVarWALAsyncIO constant (used by WAL code).
tempodb/encoding/vparquet4/block_findtracebyid.go Define EnvVarWALAsyncIO constant (used by WAL code).
tempodb/encoding/vparquet5/wal_block_test.go Add test coverage for WAL iterator with async IO enabled.
tempodb/encoding/vparquet4/wal_block_test.go Add test coverage for WAL iterator with async IO enabled.

Comment thread tempodb/encoding/vparquet5/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet5/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet5/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet5/wal_block_test.go Outdated
Comment thread tempodb/encoding/vparquet5/block_findtracebyid.go
Copilot AI review requested due to automatic review settings April 14, 2026 18:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread tempodb/encoding/vparquet5/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet5/wal_block_test.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread tempodb/encoding/vparquet4/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet4/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet5/wal_block.go Outdated
Comment thread tempodb/encoding/vparquet4/wal_block.go Outdated
Copilot AI review requested due to automatic review settings April 15, 2026 19:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread tempodb/encoding/vparquet4/wal_block.go
@zhxiaogg zhxiaogg requested a review from mattdurham April 16, 2026 15:28
@zhxiaogg zhxiaogg merged commit 5002d28 into grafana:main Apr 16, 2026
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants