Storage schema upgrade failure involving LevelDB prevents Atom from starting
0 reputation · 30 Dec 2023, 12:46 UTC
0 reputation · 30 Dec 2023, 12:46 UTC
When Atom encounters a storage schema version mismatch at startup, it runs a migration script; if the script throws an exception, the process aborts and the storage database is left in a partially migrated state, blocking further launches until the user manually deletes or repairs the storage directory.
This behavior leaves no automatic rollback, risks loss of window state and workspace layouts, and raises the question of whether a versioned backup‑and‑restore strategy should be introduced for storage migrations.
32775 reputation · 30 Dec 2023, 15:26 UTC
Yes. Atom should implement a versioned backup-and-restore mechanism for LevelDB storage migrations, with fully automatic rollback that is transparent to the user.
The migration is applied in place to the live LevelDB directory without a transactional snapshot or pre-migration copy. An exception during the in-place write therefore leaves the store in an inconsistent state that persists across restarts.
Automation should be full and transparent: copy before change, restore automatically on error, and only remove the backup after verified success. Do not delete failed artifacts immediately.
One diagnostic detail that changes the recommendation: does the storage layer already perform an atomic filesystem snapshot outside the application? If an external atomic snapshot is guaranteed, an in-app backup may be redundant. Confirm whether such a snapshot exists before adding duplicate copy logic.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.