fix(sqlite-native): delete metadata before chunk range#4638
Conversation
PR Review: fix(sqlite-native): delete metadata before chunk rangeWhat the Change DoesThe Before: chunks deleted first, metadata deleted second Correctness: The Fix is SoundThis is a genuine crash-safety improvement. The two KV operations are not atomic, so failure/crash ordering matters. Old order (chunks first, metadata second): If the process crashes after New order (metadata first, chunks second): If the process crashes after deleting metadata but before the range delete finishes, orphaned chunk data is left behind. Since no metadata key points to those chunks, Issues FoundRequired: WASM VFS Parity Violation CLAUDE.md mandates the native Rust VFS and the WASM TypeScript VFS must match 1:1, and when changing any VFS behavior in one implementation, update the other. The WASM counterpart in Low: Missing Ordering Rationale Comment
Low: No Test Coverage No test verifies the crash-safety property. A test confirming that a file with deleted metadata but present chunks is treated as nonexistent by Summary
|
12c0baa to
61b5457
Compare
459dd12 to
d7b2c43
Compare
61b5457 to
bc7e3d7
Compare
d7b2c43 to
6c17fae
Compare
bc7e3d7 to
49fae2b
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: