Skip to content

Fixing unreleased column_family ref when using options.ini for rocksdb#16

Merged
ls4154 merged 2 commits into
ls4154:masterfrom
BU-DiSC:master
Dec 25, 2023
Merged

Fixing unreleased column_family ref when using options.ini for rocksdb#16
ls4154 merged 2 commits into
ls4154:masterfrom
BU-DiSC:master

Conversation

@littlepig2013
Copy link
Copy Markdown
Contributor

When specifying 'options.ini' to benchmark rocksdb, there would be an assertion error because the column family refs are not fully released yet. For example, /ycsb -load -run -db rocksdb -P workloads/workloadb -p rocksdb.optionsfile=rocksdb/options.ini ends up with the following assertion error:

db/column_family.cc:1618: rocksdb::ColumnFamilySet::~ColumnFamilySet(): Assertion `last_ref' failed.

This commit makes the cf_handles a private member of the rocksdb instance and releases the refs by deleting the pointers stored in cf_handles.

@ls4154
Copy link
Copy Markdown
Owner

ls4154 commented Dec 22, 2023

Hi, thank you for finding the bug. I missed it since I don't use option files often.

One problem is that RocksdbDB::Cleanup will be called by each client thread.
So we need to prevent race for handle deletion.

I think deleting handles should be done after the lock_guard and refcount check.
Can yo add a commit to fix this?

@ls4154
Copy link
Copy Markdown
Owner

ls4154 commented Dec 22, 2023

In addition, since rocksdb instance is shared across threads, cf_handle should be a static variable.
The thread that opens db and the thread that deletes db might be different.

@littlepig2013
Copy link
Copy Markdown
Contributor Author

Thanks for your feedback! I added a new comment with fixing your comments!

@ls4154 ls4154 merged commit e12c71b into ls4154:master Dec 25, 2023
@ls4154
Copy link
Copy Markdown
Owner

ls4154 commented Dec 25, 2023

Merged into master. I've added a missing static cf_handles_ definition.

Thanks for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants