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

TransactionDB->CreateColumnFamilies doesn't create valid column family handles #10322

Closed
DaMatrix opened this issue Jul 7, 2022 · 2 comments
Closed

Comments

@DaMatrix
Copy link
Contributor

DaMatrix commented Jul 7, 2022

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev

Expected behavior

The column families created by TransactionDB->CreateColumnFamilies should be able to be used normally.

Actual behavior

TransactionDB->CreateColumnFamilies is able to complete successfully, but attempting to use the returned column families will result in an error along the lines of Column family id not found: ###. Using the non-batched TransactionDB->CreateColumnFamily multiple times works as expected.

I'm pretty sure the error is coming from PointLockManager::TryLock, because the created column families aren't being added to the lock manager. PessimisticTransactionDB overrides CreateColumnFamily in order to invoke lock_manager_->AddColumnFamily(*handle); on success, but CreateColumnFamilies isn't overridden and therefore probably isn't notifying lock_manager_.

Additionally, I'm fairly certain that the same problem would also occur with DropColumnFamily/DropColumnFamilies, except that it would never remove the column families from the lock manager.

Steps to reproduce the behavior

Run this simple example program.

DaMatrix added a commit to PorkStudios/FarPlaneTwo that referenced this issue Jul 7, 2022
@riversand963
Copy link
Contributor

Thanks @DaMatrix for reporting. Would you be willing to contribute a fix?

@DaMatrix
Copy link
Contributor Author

DaMatrix commented Jul 9, 2022

Sure, I can give it a shot in a little while.

However, I wouldn't be surprised if there were a few other bugs with the same root cause (i.e. methods not being overridden (properly) by *TransactionDB), so it would probably still be good if someone with a little more expertise than me could give it a look and might be able to catch a few more bugs while they were at it, as I don't have much of any experience with rocksdb's codebase beyond grep -rn :)

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 a pull request may close this issue.

2 participants