Open schomatis opened 6 years ago
@schomatis is that manifest file in flatfs the repo size? or is that leveldb being opened up?
@whyrusleeping I'm not familiar with flatfs
internals so I don't really know what is that manifest file for (also not sure what leveldb is being used for).
While adding content if the repo runs out of disk space the datastore might enter into a deadlock. I'm submitting this issue and a simple PoC to discuss how likely this scenario might be and if some precautionary measures should be taken. Although my main focus (and where this problem is more likely) is the Badger datastore this is also manifested for the
flatfs
datastore.The summary is that if the partition gets completely filled (e.g., while adding content or by force of other system sharing the partition with IPFS) the natural
ipfs repo gc
command the user would try to release space fails as it first tries to write to the repo (this also happens for other simpler diagnostic commands). This seemed like an obvious problem in the Badger datastore (because of its inner workings) but a test for the flat datastore also has similar issues (as I'm seeing the datastore writes to a manifest file I wasn't aware of).Note the following PoC uses a tiny chunk size (50 bytes) to fill the partition up to the top, this is not realistic and it's just a simple test, what I would like to know is how likely the partition would get "really" full by means of a normal operation.
A situation like this is more severe for Badger as the system would need to write much more information (in the form of key deletion entries) to force an actual GC and release of space (that couldn't be cleanly done by removing specific key files from the partition as is the case for
flatfs
).