mx-chain-go
mx-chain-go copied to clipboard
Open more dbs if necessary
Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring)
- In order to have the complete state, we need 2 trie dbs marked as active. When restarting the node, we have to be sure that a minimum of 2 trie dbs marked as active are also opened, else the node will not have access to the entire state.
Proposed Changes
- When a node is restarting, opend trie dbs until there are a minimum of 2 that are marked as active (if the trie was synced, only one db marked as active is needed)
Testing procedure
- Restart a node after there is a snapshot that takes more than one epoch, and check that the dbs are opened and closed correctly (this will be tested on a different branch, in which a time.Sleep() is added in order to force the snapshot process to take more than an epoch)
Codecov Report
Merging #4366 (675c3e3) into rc/v1.4.0 (c6101b4) will increase coverage by
0.00%. The diff coverage is77.68%.
@@ Coverage Diff @@
## rc/v1.4.0 #4366 +/- ##
==========================================
Coverage 73.84% 73.84%
==========================================
Files 686 688 +2
Lines 88038 88087 +49
==========================================
+ Hits 65011 65049 +38
- Misses 18118 18130 +12
+ Partials 4909 4908 -1
| Impacted Files | Coverage Δ | |
|---|---|---|
| factory/processComponents.go | 53.18% <0.00%> (-0.06%) |
:arrow_down: |
| storage/factory/pruningStorerFactory.go | 0.00% <0.00%> (ø) |
|
| storage/pruning/pruningStorer.go | 73.58% <86.11%> (+0.17%) |
:arrow_up: |
| epochStart/bootstrap/metaStorageHandler.go | 72.85% <100.00%> (+0.19%) |
:arrow_up: |
| epochStart/bootstrap/process.go | 85.34% <100.00%> (+0.01%) |
:arrow_up: |
| epochStart/bootstrap/shardStorageHandler.go | 87.80% <100.00%> (+0.02%) |
:arrow_up: |
| factory/dataComponents.go | 53.53% <100.00%> (+0.47%) |
:arrow_up: |
| storage/pruning/fullHistoryTriePruningStorer.go | 91.66% <100.00%> (+0.36%) |
:arrow_up: |
| storage/pruning/persistersTracker.go | 100.00% <100.00%> (ø) |
|
| storage/pruning/triePersistersTracker.go | 100.00% <100.00%> (ø) |
|
| ... and 2 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.