Skip to content

Add test coverage for database conversion crash recovery scenarios#839

Closed
Copilot wants to merge 1 commit intofixes.datalost.conversionfrom
copilot/sub-pr-838
Closed

Add test coverage for database conversion crash recovery scenarios#839
Copilot wants to merge 1 commit intofixes.datalost.conversionfrom
copilot/sub-pr-838

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 28, 2025

Addresses review feedback on #838 requesting test coverage for crash scenarios during database format conversion.

Test Coverage Added

Two tests validate crash recovery during DB format conversion (natural → hierarchical):

  • TestPebbleDbConversionPreservesDataAfterCrash: Crash after moving old DB to backup but before moving new DB into place

    • Simulates crash at line 263 of kv_pebble_formats.go
    • Verifies system restores from backup and completes conversion
    • Confirms no data loss after recovery
  • TestPebbleDbCleanupExpiredBackup: Crash after moving new DB into place but before deleting backup

    • Simulates crash at line 271 of kv_pebble_formats.go
    • Verifies system cleans up orphaned backup on retry
    • Confirms backup is removed after successful conversion

Both tests use the trap mechanism to inject failures at specific points in the conversion flow, then verify recovery behavior on retry.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add test for convertCrashAfterMoveOldDb case Add test coverage for database conversion crash recovery scenarios Dec 28, 2025
Copilot AI requested a review from mattisonchao December 28, 2025 01:05
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