Closed cool-develope closed 11 months ago
were you able to test the issue berachain ran into here?
It should be possible to prove the theory in this PR as to the cause of value missing error
. Can you create a failing test case which is then fixed by this patch?
It should be possible to prove the theory in this PR as to the cause of
value missing error
. Can you create a failing test case which is then fixed by this patch?
The main reason of this issue is due to batch writing breaks, I have no idea of how to break the batch writing in test. To simulate the above issue, we should break the batch writing while commit, and re-load the tree. Do you have any idea?
@elias-orijtech @odeke-em This is a PR that was mentioned before. I struggle to add test cases since the issue concerns low-level API (batch writing). The failure case is triggered by loading the broken tree. To break the tree state, the app should panic while writing the batch.
@cool-develope I don't have any comments apart from what @kocubinski said about needing a test case to make sure this PR fixes what it claims.
@cool-develope I don't have any comments apart from what @kocubinski said about needing a test case to make sure this PR fixes what it claims.
That's what I struggle now, could you help me add a test case?
Thanks @cool-develope and @tac0turtle for the ping, I am working on helping out with the test for this.
Admittedly, it's a bit hard to provide a thorough test case give we'd need to work with the internals of go leveldb batching. I think I'm OK merging this as-is; moving the creation of the batch from pre-order to post-order should move the entire SaveVersion batch to behave like a transaction.
The changes primarily focus on improving the handling of the fast storage version in the MutableTree
and nodeDB
structures. The latest version is now passed as an argument to relevant methods, enhancing code clarity and decoupling. Test cases have been updated to reflect these changes.
File(s) | Summary |
---|---|
migrate_test.go |
Updated legacyVersion variable in TestLegacyReferenceNode function. |
mutable_tree.go |
Enhanced handling of fast storage version in MutableTree struct and its methods. |
nodedb.go , nodedb_test.go |
Refactored setFastStorageVersionToBatch function in nodeDB struct to take latestVersion as an argument. Updated test cases accordingly. |
tree_test.go |
Updated expected values in TestNodeCacheStatisic test case. |
ππ»
In the land of code, where logic is king,
Changes were made, improvements they bring.
Fast storage version, handled with care,
Tests updated too, fair and square.
Celebrate the changes, for they are fine,
In the world of code, where we rabbits shine. ππ₯
@mergifyio backport release/v1.x.x
backport release/v1.x.x
Context
We faced with
value missing error
sometimes. I think it is related to recent works ofnodekey refactoring
andbatch flusher
.batch flusher
, we have one atomic batch write but now there can be several batch writes, so some batch data can be away when the app is in panic.nodekey refactoring
As a result, there may be a situation that has only a root node, not entire nodes storing.
Action
Refactored the storing nodes order to save the root at last
Summary by CodeRabbit
These changes are primarily under-the-hood improvements and should not affect the user experience directly. However, they lay the groundwork for more efficient data handling and future feature development.