You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently running into an issue where the files a RocksDb instance used to point to still exist after disposing and doing a Directory.Delete(<path>) on those files and switching to a new RocksDb instance on a different directory.
Expected behavior
All file handles a RocksDb instance is using are released upon calling Dispose().
Actual behavior
Running lsof while the process is still running, after dispose and directory deletion have occurred, I see that the *.sst files are marked as (deleted).
Steps to reproduce the behavior
In C#, I create a RocksDb instance with RocksDb.OpenReadOnly(<options>, <path>, true).
I want to swap it with a new RocksDb instance I have staged with all new data (at a different path/directory).
a. While the first instance is still undisposed, I also created another RocksDb instance with RocksDb.OpenReadOnly(<options>, <different-path>, true).
b. After I point the current instance to the new instance (keeping track of the old instance), I call Dispose() on the old instance and call Directory.Delete(<path>).
Running 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 2a and 2b repeat every few hours, so eventually disk space fills up).
Other things tried
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.
Also tried replacing all of the RocksDb.OpenReadOnly calls with RocksDb.Open and the same issue persists.
Additional information
Currently using RocksDbSharp from Curiosity in C#, version 6.15.5.15759 (latest stable version) from NuGet Package Manager.
The text was updated successfully, but these errors were encountered:
After careful re-examination of code using Iterators, 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 Iterators!
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 and switching to a newRocksDb
instance on a different directory.Expected behavior
All file handles a
RocksDb
instance is using are released upon callingDispose()
.Actual behavior
Running
lsof
while the process is still running, after dispose and directory deletion have occurred, I see that the*.sst
files are marked as(deleted)
.Steps to reproduce the behavior
RocksDb
instance withRocksDb.OpenReadOnly(<options>, <path>, true)
.RocksDb
instance I have staged with all new data (at a different path/directory).a. While the first instance is still undisposed, I also created another
RocksDb
instance withRocksDb.OpenReadOnly(<options>, <different-path>, true)
.b. After I point the current instance to the new instance (keeping track of the old instance), I call
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 2a and 2b repeat every few hours, so eventually disk space fills up).Other things tried
Native.Instance.rocksdb_destroy_db(dboptions.Handle, <directory-name>);
which disposes and deletes the directory, but it still doesn't release the file handles.RocksDb.OpenReadOnly
calls withRocksDb.Open
and the same issue persists.Additional information
The text was updated successfully, but these errors were encountered: