Skip to content

[core] Make LocalKvDb flush failure-safe - #8869

Merged
JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/fix-local-kv-flush-failure
Jul 28, 2026
Merged

[core] Make LocalKvDb flush failure-safe#8869
JingsongLi merged 1 commit into
apache:masterfrom
JingsongLi:codex/fix-local-kv-flush-failure

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Purpose

Make LocalKvDb flush failure-safe.

Changes

  • Keep the memtable intact until the SST has been written and published to level 0.
  • Remove an incomplete SST when writing or closing the writer fails.
  • Add a regression test that injects a flush failure and verifies that reads and a later retry still succeed.

Verification

  • mvn -q -pl paimon-common -Pfast-build -DwildcardSuites=none '-Dtest=LocalKvDbTest#testFlushFailureKeepsMemTableForRetry+testFlushToSst+testCloseFlushesMemTable' test
  • mvn -q -pl paimon-common spotless:check -DskipTests
  • mvn -q -pl paimon-common -DskipTests compile

@JingsongLi
JingsongLi marked this pull request as ready for review July 27, 2026 16:25

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. The MemTable is retained until the SST is fully written and published, and failed writers/files are cleaned up without losing retryability. LocalKvDbTest passes locally.

@JingsongLi
JingsongLi merged commit 2e8f69a into apache:master Jul 28, 2026
13 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.

2 participants