Skip to content

fix(storage): preserve WAL on checkpoint failure - #177

Open
WangXukang-cypher wants to merge 1 commit into
modelscope:mainfrom
WangXukang-cypher:fix/preserve-wal-on-checkpoint-failure
Open

fix(storage): preserve WAL on checkpoint failure#177
WangXukang-cypher wants to merge 1 commit into
modelscope:mainfrom
WangXukang-cypher:fix/preserve-wal-on-checkpoint-failure

Conversation

@WangXukang-cypher

Copy link
Copy Markdown

Summary

  • Preserve the DuckDB WAL file when checkpoint recovery fails instead of deleting it.
  • Propagate checkpoint errors to prevent startup from continuing after an unsuccessful recovery.
  • Ensure the temporary DuckDB connection is closed on both success and failure.

Deleting the WAL after a failed checkpoint can permanently discard committed transactions that have not yet been merged into the main database file.

Test plan

  • Verified src/sirchmunk/storage/duckdb.py compiles with python3 -m py_compile.
  • Verified checkpoint errors are propagated instead of being swallowed.
  • Verified the WAL file and its contents are preserved when checkpoint recovery fails.
  • Verified the temporary DuckDB connection is closed after a checkpoint failure.
  • Passed trailing-whitespace and end-of-file checks.
  • Passed the added-large-file check.
  • Passed Ruff checks.
  • Confirmed the repository currently has no pytest tests to collect.

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.

1 participant