Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sst file deleted but fd not released #113

Open
freewings85 opened this issue Aug 6, 2019 · 1 comment
Open

sst file deleted but fd not released #113

freewings85 opened this issue Aug 6, 2019 · 1 comment

Comments

@freewings85
Copy link

i found when compact happen, useless sst file is deleted but maybe file channel.close is not called so if you use lsof, it shows like below, or maybe there is somewhere else these file channel close will be called?
java 94251 94401 root 573r REG 253,2 1540703 203177060 /home/root/test/leveldbtest/001014.sst (deleted)
java 94251 94401 root 574r REG 253,2 1540770 203177061 /home/root/test/leveldbtest/001016.sst (deleted)
java 94251 94401 root 577r REG 253,2 1540767 203177072 /home/root/test/leveldbtest/001030.sst (deleted)
java 94251 94401 root 579r REG 253,2 1540710 203177066 /home/root/test/leveldbtest/001022.sst (deleted)
java 94251 94401 root 585r REG 253,2 1739557 203177071 /home/root/test/leveldbtest/001028.sst (deleted)
java 94251 94401 root 586r REG 253,2 1540709 203177073 /home/root/test/leveldbtest/001032.sst (deleted)
java 94251 94401 root 587r REG 253,2 1540768 203177074 /home/root/test/leveldbtest/001034.sst (deleted)
java 94251 94401 root 589r REG 253,2 1540710 203177076 /home/root/test/leveldbtest/001037.sst (deleted)
java 94251 94401 root 590r REG 253,2 1540769 203177077 /home/root/test/leveldbtest/001039.sst (deleted)
java 94251 94401 root 591r REG 253,2 1540711 203177078 /home/root/test/leveldbtest/001041.sst (deleted)
java 94251 94401 root 592r REG 253,2 1540769 203177079 /home/root/test/leveldbtest/001043.sst (deleted)

@pcmind
Copy link
Contributor

pcmind commented Aug 25, 2019

Implementation of TableCache.java use Finalizer.java to close sst files. Finalizer.java use phantom reference to delay table/file handle close; so file handle may be closed long after DB has (tried) delete it.
This is even worse in Windows as file reference (in file tree) can only be deleted after close really happen.

One possible solution would be the one in pcmind/leveldb fork commit; change is quite big, so if acceptable in this repository (due to its maintenance state), a PR could be done out of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants