-
Notifications
You must be signed in to change notification settings - Fork 51
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
feat: add pebbledb #112
feat: add pebbledb #112
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #112 +/- ##
==========================================
- Coverage 77.53% 77.15% -0.39%
==========================================
Files 22 23 +1
Lines 1785 2057 +272
==========================================
+ Hits 1384 1587 +203
- Misses 342 399 +57
- Partials 59 71 +12
|
Here's why:
|
In order to write good benchmarks we need to merge this. |
FYI, this one JUST AND ONLY adds pebble.
|
So it seems that golevelDB is only more performant when we have small keys and write fewer of them (the first few lines). I am wondering what would the numbers look like for 64KB requests (which is the default block part size in Comet) , so it would be great to benchmark that. |
pebble.go
Outdated
This is set at compile time. Could be 0 or 1, defaults is 0. | ||
It will force using Sync for NoSync functions (Set, Delete, Write) | ||
|
||
Used as a workaround for chain-upgrade issue: At the upgrade-block, the sdk will panic without flushing data to disk or |
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.
How was this handled with existing databases where we did not introduce this ForceSync
flag?
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.
I think that it may make more sense to go through #115 -- it uses pebbledb 1.0 and doesn't seem to need this, but @baabeetaa can provide more context I think.
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.
i havent tried newer version of pebbledb. With current version, set it default to 1 instead.
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.
btw, i'll test upgrading without ForceSync=1 with new version of pebbledb tomorrow and report.
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.
Nice -- could you test the #115 branch?
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.
ok, there will be Omniflix mainnet upgrade tomorrow.
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.
i tried upgrading Omniflix with pebble v1.0.0. It doesnt work without using ForceSync
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.
Imo, using default ForceSync=1 shoulnt be a problem.
https://github.com/cockroachdb/pebble/blob/master/options.go#L356
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.
i updated default ForceSync=1, so no need to use this flag when upgrading.
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
Co-authored-by: Jasmina Malicevic <jasmina.dustinac@gmail.com>
I think that #115 is overall better and is better for review. This PR is a cherry pick of @baabeetaa 's 2 year old work, and is missing things like the stats method, which are in #115 #115 also uses a more recent pebbledb. |
Should we just keep #115 and close this then? Or is there anything specific in this PR that is valuable? |
I don't have any objections, the reason I went over this one is that it was clean and only changing Pebble. I would like to avoid changing existing behaviour of pre-existing DBs in #115 but otherwise no objections to closing this in favor of #115. |
I run iavl bench Large for:
the differences are several percentages. So could set ForceSync=1 as default to avoid the upgrading issue without hurting performance much. |
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.
Thanks @baabeetaa and @faddat ❤️
|
||
Notice if ForceSync=0: performance will be better. However, there is an issue when upgrading. | ||
And the workaround (if using ForceSync=0): | ||
At the upgrade-block, the sdk will panic without flushing data to disk or closing dbs properly. |
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.
I didn't get it. Isn't the solution to use SetSync
in the SDK? instead of forcing all ops to be sync
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.
i agree. However, this isnt an issue with goleveldb which is the default db. And other dbs are experiments atm.
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.
Does it not degrade performance if done needlessly?
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.
Still, the right way is to patch Cosmos SDK, not leave this hack even though pebbledb is experimental. Please remove
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.
Sir, it could be a big problem for node operators who run nodes for different chains and different sdk versions.
Also when syching archive nodes from genesis requires a lot of upgrades.
This hack is not the best way to fix. But it works.
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
@baabeetaa or @faddat - could you please resolve conflicts? |
This PR also lacks a changelog entry. Please add one ☝️ |
Changelog entry must be added in .changelog (we use unclog to manage our changelog) |
Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
renamed 112-add-pebbledb.md to 112-pebbledb.md
This is a basic PR adding pebbledb.
Its license remains unchanged, apache 2.
Closes #90