Closed dinardov closed 3 years ago
After careful re-examination of code using Iterator
s, there was an edge case where an exception was being thrown and skipping disposal prior to calling Dispose()
on the Iterator
. I would recommend always using a using
block for iterators to prevent this, and if that's not possibly doing a try/catch/finally block immediately after Iterator
declaration, and calling Dispose()
on the Iterator
in finally.
Thanks to this comment for the hint to reassess Iterator
s!
Also cross-referencing this question with duplicate on facebook/rocksdb repo.
I'm currently running into an issue where the files a
RocksDb
instance used to point to still exist after disposing and doing aDirectory.Delete(<path>)
on those files. Here's the sequence so far:RocksDb
instance withRocksDb.OpenReadOnly(<options>, <path>, true)
.RocksDb
instance (also created withRocksDb.OpenReadOnly
) I have staged with all new data (at a different path/directory).Dispose()
on the old instance and callDirectory.Delete(<path>)
.lsof
(list of open files) while the process is still running, I see that the*.sst
files are marked as(deleted)
, but they still have file handles open; even though the files and directory don't exist, they take up disk space, even after many hours, seemingly indefinitely (this swapping part from 2 and 3 repeat every few hours, so eventually disk space fills up).Also tried to call
Native.Instance.rocksdb_destroy_db(dboptions.Handle, <directory-name>);
which disposes and deletes the directory, but it still doesn't release the file handles.EDIT: Also tried replacing all of the
RocksDb.OpenReadOnly
calls withRocksDb.Open
and the same issue persists.