-
Notifications
You must be signed in to change notification settings - Fork 365
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
Remove database flush #575
Remove database flush #575
Conversation
3278ea5
to
9947611
Compare
9947611
to
bfaef77
Compare
bfaef77
to
d107b92
Compare
I think your code changes to remove flush from the Database trait and to refactor duplicate code into the But I'm having second thoughts on doing the auto-flush. I believe it's not meant to be used on every update since it will hurt performance and on most os/filesystems it is not needed since the os will automatically flush the data to disk if the process dies. For Android users it's reasonable to recommend using sqlite and not sled for now. In future bdk api changes that are currently being discussed the database will most likely be extracted from the You also need to do a |
d107b92
to
64a4f1b
Compare
That's very reasonable. Thank you so much for your comment. I have removed the auto-flush behaviour(and ran cargo fmt, clippy for each commit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 6dc9282
With few nits..
@notmandatory so we don't need the explicit |
The only database that actually implemented flush was Sled, and even for Sled it seems to only be needed for Android. That's why I suggested removing it and that mobile apps use sqlite instead. This #409 is the PR that added it, and it was to trying to fix the issues that @thunderbiscuit ran into on Android. |
Maybe we should deprecate for one release before removing it? I don't know if anybody is using it, but it seems it wouldn't cost us anything to just delay the removal and it can make the transition a bit less painful for our users. Concept ACK for the refactor but I'll take another look later to make sure the code is also good. |
Good point, I was assuming no one was using this but I think we did promise to deprecate APIs before removing them. If we do deprecate that should go in a new PR, so this one can be ready to go right after we cut the next release branch. |
5379a34
to
0e713f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReACK 0e713f8
I've assigned this to the release |
a111d25 Deprecate Database::flush() function (Steve Myers) Pull request description: ### Description The Database::flush() function is only needed for the sled database on mobile, instead for mobile use the sqlite database. ### Notes to the reviewers This PR is in preparation for removing the Database::flush() function. See #575 (comment). After the `release/0.18.0` feature freeze branch is created then #575 should be merged. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### New Features: * [ ] I've added tests for the new feature * [ ] I've added docs for the new feature * [x] I've updated `CHANGELOG.md` ACKs for top commit: afilini: ACK a111d25 Tree-SHA512: 18434dc95dbef47118a0d4fface908bdf920a7ffcef927b36bb740c15f8efcf11dea9198b364648f16f74aaec4aa18e92a3c5e925299b2f3b9d69e566f89e790
Hi, please rebase to pickup changes in #596. Thanks! |
0e713f8
to
b1ace3c
Compare
I had to push this PR to the next release so the team can focus on #593, and after that one you'll probably need to rebase again. But then I promise we get this one in. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK b1ace3c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK b1ace3c
This looks ready for merge to me..
This PR needs rebase to fix the CHANGELOG.md conflicts and fix the CI, but then it's ready to merge 🙏🏻 |
b1ace3c
to
e4c9919
Compare
e4c9919
to
5ff8320
Compare
re-ACK 5ff8320 |
Finally merged, thanks for seeing this one through! |
Description
This PR is to remove Database::flush. See this issue for detail #567
Notes to the reviewers
The 2nd commit is a small refactoring of adding a new private ivec_to_u32 to avoid too much code duplication. Please let me know if it's ok to include this in this PR or I should make it into a separate PR
Currently existing test cases are shared across for all Databaes implementation so I am not sure if we should add specific test cases for keyvalue(Tree) for this auto-flush behaviour?(and I feel like it's more a implementation detail). Please let me know how should I proceed for test case in this PR
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md
Bugfixes: