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

Enable rocksdb.enable_blob_files will cause blob files leak #2604

Closed
1 of 2 tasks
sryanyuan opened this issue Oct 17, 2024 · 9 comments · Fixed by #2614
Closed
1 of 2 tasks

Enable rocksdb.enable_blob_files will cause blob files leak #2604

sryanyuan opened this issue Oct 17, 2024 · 9 comments · Fixed by #2614
Labels
bug type bug

Comments

@sryanyuan
Copy link
Contributor

sryanyuan commented Oct 17, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Version

centos 7.9/5.10.109-1.el7.x86_64,kvrocks 2.10.0

Minimal reproduce step

Enabling rocksdb.enable_blob_files and continuing writing data with ttl will cause disk full finally. By checking the file descriptors of the kvrocks process, we can determine that many blob files have been deleted but are still open by kvrocks.

What did you expect to see?

disk usage stable

What did you see instead?

disk full finally

Anything Else?

We checked the issue list of rocksdb, the issue may be related to this. The recent release version 2.10.0, which upgraded rocksdb to 9.6.1, may pose a potential risk for users of old versions who have the option rocksdb.enable_blob_files enabled.

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@sryanyuan sryanyuan added the bug type bug label Oct 17, 2024
@git-hulk
Copy link
Member

git-hulk commented Oct 17, 2024

@sryanyuan Thanks for your information. Will keep an eye on this issue and apply it in Kvrocks ASAP.

@ilyaevseev
Copy link

ilyaevseev commented Oct 19, 2024

The same problem with kvrocks 2.10.0 and rocksdb.enable_blob_files=yes:

# lsof -n > /run/lsof.log 2>/dev/null
# egrep -c 'kvrocks.*deleted' /run/lsof.log 
3060

# egrep '^(COMMAND|kvrocks.*deleted)' /run/lsof.log | less
COMMAND       PID     TID TASKCMD              USER   FD      TYPE             DEVICE  SIZE/OFF       NODE NAME
kvrocks    415416                               999    7r      REG              259,1 123878620    2627813 /var/lib/kvrocks/db/000065.blob (deleted)
kvrocks    415416                               999    8r      REG              259,1 123878620    2627787 /var/lib/kvrocks/db/000051.blob (deleted)
kvrocks    415416                               999   50r      REG              259,1 235657931    2627945 /var/lib/kvrocks/db/000189.blob (deleted)
kvrocks    415416                               999   57r      REG              259,1 181792793    2627901 /var/lib/kvrocks/db/000738.blob (deleted)
...

# df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb        33G   33G   55M 100% /mnt/data

# docker restart kvrocks
kvrocks

# df -h .
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb        33G   13G   21G  38% /mnt/data

@git-hulk
Copy link
Member

@ilyaevseev Thanks for your investigation. We would like to have a patch release in a few days. Should we revert the RocksDB to 8.11.4 in this patch release as well? @apache/kvrocks-committers

@PragmaTwice
Copy link
Member

Yeah I think we can use rocksdb 8.11 in 2.10.1.

@PragmaTwice
Copy link
Member

Also in the future maybe we can expose uncache_aggressiveness to users, according to facebook/rocksdb@b34cef5.

@ilyaevseev
Copy link

ilyaevseev commented Oct 20, 2024

Yeah I think we can use rocksdb 8.11 in 2.10.1.

Is RocksDB 8.11 compatible with 9.x by data formats?
I.e., should we recreate our databases from scratch after Kvrocks upgrade from 2.10 to 2.10.1 ?

@PragmaTwice
Copy link
Member

PragmaTwice commented Oct 20, 2024

Yeah I think we can use rocksdb 8.11 in 2.10.1.

Is RocksDB 8.11 compatible with 9.x by data formats? I.e., should we recreate our databases from scratch after Kvrocks upgrade from 2.10 to 2.10.1 ?

From here for forward compatibility it said that:

an older release of RocksDB should be able to open DB generated by releases at least several minor versions higher, if no new features are explicitly enabled by users which are not supported in older versions

So I think we can do some experiments before we do the downgrade. cc @git-hulk
Also, we can choose v9.3.1 which didn't introduce this issue.

I prefer v9.3.1 than v8.11 since v8 seems a far big downgrade.

cc @mapleFU

@git-hulk
Copy link
Member

git-hulk commented Oct 20, 2024

@PragmaTwice Downgrade to 9.3.1 is also good to me since this issue was first introduced in RocksDB 9.4.0

@mapleFU
Copy link
Member

mapleFU commented Oct 21, 2024

I prefer v9.3.1 than v8.11 since v8 seems a far big downgrade.

I agree downgrade to 9.3.1

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

Successfully merging a pull request may close this issue.

5 participants