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

os/bluestore: Make BitmapFreelistManager kv itereator short lived. #16243

Merged
merged 1 commit into from Jul 13, 2017

Conversation

Projects
None yet
2 participants
@markhpc
Member

markhpc commented Jul 10, 2017

Various KV stores want to keep read iterators/cursors/etc as short lived as possible. This PR resets KeyValueDB iterator in BitmapFreelistManager when enumerate is reset. In addition to calling enumerate_reset before enumerate loops, it calls it afterward as well.

In rocksdb:

"An iterator keeps a reference count on all underlying files that correspond to that point-in-time-view of the database - these files are not deleted until the Iterator is released."

In lmdb:

"While any reader exists, writers cannot reuse space in the database file that has become unused in later versions. Due to this, continual use of long-lived read transactions may cause the database to grow without bound."

Without this change an lmdb backed bluestore db will grow without bound (tested up to 93GB after several minutes of 4kb writes to an NVMe). With this change, the database grows to ~122MB.

Rocksdb may not suffer as badly, though still may keep some files open indefinitely without the change.

Signed-off-by: Mark Nelson mnelson@redhat.com

@markhpc markhpc changed the title from os/bluestore: Make BitmapFreelistManager kv itereator short lived. to [DNM]os/bluestore: Make BitmapFreelistManager kv itereator short lived. Jul 10, 2017

@markhpc

This comment has been minimized.

Show comment
Hide comment
@markhpc

markhpc Jul 11, 2017

Member

retest this please

Member

markhpc commented Jul 11, 2017

retest this please

os/bluestore: Make BitmapFreelistManager kv itereator short lived.
Signed-off-by: Mark Nelson <mnelson@redhat.com>
@markhpc

This comment has been minimized.

Show comment
Hide comment
@markhpc

markhpc Jul 12, 2017

Member

retest this please

Member

markhpc commented Jul 12, 2017

retest this please

@markhpc markhpc changed the title from [DNM]os/bluestore: Make BitmapFreelistManager kv itereator short lived. to os/bluestore: Make BitmapFreelistManager kv itereator short lived. Jul 12, 2017

@liewegas liewegas added this to the luminous milestone Jul 12, 2017

@liewegas liewegas merged commit 27e8b8b into ceph:master Jul 13, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment