Skip to content

Remove need for &mut self in create_cf and drop_cf (v2)#506

Merged
aleksuss merged 31 commits intorust-rocksdb:masterfrom
ryoqun:DropCfTypeSafe
Apr 6, 2021
Merged

Remove need for &mut self in create_cf and drop_cf (v2)#506
aleksuss merged 31 commits intorust-rocksdb:masterfrom
ryoqun:DropCfTypeSafe

Conversation

@ryoqun
Copy link
Copy Markdown
Contributor

@ryoqun ryoqun commented Mar 26, 2021

Here's the polished version, finally!

#496 (comment)

@aleksuss Hi, again. I want this to move forward :) (cc: @carllin)

What about to bound an invoke of this with trait ??? I'll try to provide the idea with code soon.

Maybe, were you thinking about like this?: ryoqun@1be386d

Sorry for very rough code. But this eliminates bunch of various concerns arisen from this pr's review:

* ColumnFamily is bounded in the case of MultiThread with zero runtime overhead (I even stopped using Arc)

* ... and no `derive(Clone)` on `ColumnFamily`

* will have no `panic!`s (if everything is correctly rewritten)

* keeps api compatibility and no multithread methods.

* no enum runtime variant branching (although this is cheap)

* downside: a bit of internal code churn (I'll promise I'll work hard to fix them all)

If this direction is really to go from maintainer's perspective, I'll finish this very quickly. :)

tests/test_db.rs Outdated
fn test_open_as_multi_threaded() {
let primary_path = DBPath::new("_rust_rocksdb_test_open_as_multi_threaded");

let db = DbWithThreadMode::<MultiThreaded>::open_default(&primary_path).unwrap();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I wrote this, I realized there is some other compile-error message checks. ;) Maybe, should I write single thread version of this using that facility?

@ryoqun ryoqun changed the title Remove need for &mut self in create_cf and drop_cf Remove need for &mut self in create_cf and drop_cf (v2) Mar 27, 2021
@ryoqun ryoqun closed this Mar 27, 2021
@ryoqun ryoqun reopened this Mar 27, 2021
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Mar 27, 2021

@aleksuss Hi, I fixed the CIs too. (latest commits CI aren't run for some reason).

@aleksuss
Copy link
Copy Markdown
Member

@ryoqun notify me please when you'll finish to modify the PR 😉

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Mar 30, 2021

@ryoqun notify me please when you'll finish to modify the PR wink

@aleksuss oh, thanks for paying close attention to this. I think I've addressed all of my self-review comments. So, I'm finished now. Also, I actually tried to use the new api at our project, which necessitated another somewhat large changes.

For inspiration, please take a look for what would look like for the newer api change: solana-labs/solana#16227. Also, I checked 4 combination of (with/without multi-threaded-as-default, old/new api) by hand to confirm I broke nothing.

So, this looks good? happy to address any new review comments. :)

Copy link
Copy Markdown
Member

@aleksuss aleksuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks pretty good as 61f323b.
But couple nitpicks.

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Apr 6, 2021

@aleksuss @stanislav-tkach thanks for careful reviews! I've fixed all nitpicks. Could you confirm them and merge if possible? Thanks for taking some time on this. :)

Copy link
Copy Markdown
Member

@aleksuss aleksuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done ! 👍🏻

@aleksuss aleksuss merged commit 0b700fe into rust-rocksdb:master Apr 6, 2021
@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Apr 6, 2021

@aleksuss thanks for merging! I'm super excited about it. :)

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Apr 7, 2021

@aleksuss I guess you're testing the tip of master extensively for releasing 0.16.0? FYI, thanks to merging this, we're very close to the plain old version bump to use this facility, which is kind of desired for checking into our master branch: https://github.com/solana-labs/solana/pull/16227/files#r608387625

@aleksuss
Copy link
Copy Markdown
Member

aleksuss commented Apr 7, 2021

Yeah. I plan to release 0.16.0 soon.

@ryoqun
Copy link
Copy Markdown
Contributor Author

ryoqun commented Apr 13, 2021

aleksuss merged commit 0b700fe into rust-rocksdb:master 7 days ago

Yeah. I plan to release 0.16.0 soon.

🐶

@aleksuss I can lend any hand to make this happen soon. Alternatively, could you share any ETAs for this, not to make your lovely contributing puppy (= me, lol)'s eyes dim? :)

self.cfs
.cfs
.write()
.unwrap()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here

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.

4 participants