Fix fundemental BoltDB backend correctness issues.#3720
Merged
liamsi merged 2 commits intotendermint:developfrom Jun 7, 2019
Yawning:boltdb-fixes
Merged
Fix fundemental BoltDB backend correctness issues.#3720liamsi merged 2 commits intotendermint:developfrom Yawning:boltdb-fixes
liamsi merged 2 commits intotendermint:developfrom
Yawning:boltdb-fixes
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #3720 +/- ##
===========================================
+ Coverage 63.8% 63.81% +0.01%
===========================================
Files 241 241
Lines 19980 19980
===========================================
+ Hits 12748 12750 +2
+ Misses 6182 6179 -3
- Partials 1050 1051 +1
|
liamsi
reviewed
Jun 7, 2019
| b := tx.Bucket(bucket) | ||
| for _, elem := range bdb.buffer { | ||
| if putErr := b.Put(elem.k, elem.v); putErr != nil { | ||
| return putErr |
Contributor
There was a problem hiding this comment.
Ouch. How didn't we notice this during review 🤦♂ Thanks!
liamsi
approved these changes
Jun 7, 2019
CHANGELOG_PENDING.md
Outdated
| * [rpc] [\#3686](https://github.com/tendermint/tendermint/pull/3686) `HTTPClient#Call` returns wrapped errors, so a caller could use `errors.Cause` to retrieve an error code. | ||
|
|
||
| ### BUG FIXES: | ||
| - [libs/db] Fixed the BoltDB backend's Batch.Delete implementation |
Contributor
There was a problem hiding this comment.
Suggested change
| - [libs/db] Fixed the BoltDB backend's Batch.Delete implementation | |
| - [libs/db] Fixed the BoltDB backend's Batch.Delete implementation (@Yawning) |
Contributor
Author
There was a problem hiding this comment.
Fixed in the force-pushed branch.
CHANGELOG_PENDING.md
Outdated
|
|
||
| ### BUG FIXES: | ||
| - [libs/db] Fixed the BoltDB backend's Batch.Delete implementation | ||
| - [libs/db] Fixed the BoltDB backend's Get and Iterator implementation |
Contributor
There was a problem hiding this comment.
Suggested change
| - [libs/db] Fixed the BoltDB backend's Get and Iterator implementation | |
| - [libs/db] Fixed the BoltDB backend's Get and Iterator implementation (@Yawning) |
Contributor
Author
There was a problem hiding this comment.
Fixed in the force-pushed branch.
`Delete` should queue a delete operation that targets the entire database, and not just keys that happen to be in the current batch.
BoltDB's accessors will return slices that are only valid for the lifetime of the transaction. This adds copies where required to prevent hard to debug crashes (among other things).
This was referenced Jun 7, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These changes fix #3717 and #3718.