Skip to content

fix(io): flush disk cache blocks before publishing - #836

Open
QuakeWang wants to merge 1 commit into
apache:mainfrom
QuakeWang:fix-cache-flush
Open

QuakeWang wants to merge 1 commit into
apache:mainfrom
QuakeWang:fix-cache-flush

Conversation

@QuakeWang

@QuakeWang QuakeWang commented Sep 15, 2026

Copy link
Copy Markdown
Member

Purpose

Closes #835.

Tokio background writes could finish after a cache block was published, causing empty reads and intermittent persistence test failures.

Brief change log

  • Flush before publishing; reuse cleanup for write and flush errors.
  • Verify complete on-disk contents immediately after writing.

Tests

  • cargo fmt --all -- --check
  • cargo test --locked -p paimon --all-targets --features fulltext,vortex
  • cargo clippy --locked --all-targets --workspace --features fulltext,vortex -- -D warnings
  • 30 controlled runs with 0/50/500 ms write delays.

API and Format

No changes.

Documentation

Not needed.

Wait for background writes to finish before renaming cache blocks, and
clean up temporary files on write or flush errors. Verify that published
blocks are immediately readable before testing cache restart recovery.

Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
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.

Disk cache blocks can be published before writes complete

1 participant