google / leveldb

LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.
BSD 3-Clause "New" or "Revised" License
35.71k stars 7.72k forks source link

Consistent corruption when no disk space left #1180

Open shadow-light opened 2 months ago

shadow-light commented 2 months ago

I've produced a reproduction using Electron Fiddle that consistently corrupts Chromium's leveldb when there is no disk space left.

My assumption was that leveldb would preserve all existing data when a write isn't possible rather than result in a corruption of the database.

This gist can be run using Electron Fiddle. It has resulted in a db corruption every time I've tested it.