-
Notifications
You must be signed in to change notification settings - Fork 198
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
storage, factory: fix bootstrap from storage after import #3531
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3531 +/- ##
=======================================
Coverage 73.87% 73.88%
=======================================
Files 582 581 -1
Lines 74618 74583 -35
=======================================
- Hits 55122 55102 -20
+ Misses 15086 15077 -9
+ Partials 4410 4404 -6
Continue to review full report at Codecov.
|
@@ -61,29 +61,54 @@ func NewLatestDataProvider(args ArgsLatestDataProvider) (*latestDataProvider, er | |||
}, nil | |||
} | |||
|
|||
// Get will return a struct containing the latest data in storage | |||
// Get will return a struct containing the latest usable data for the full archive node in storage |
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.
not necessary for the full archive right now
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.
done
} | ||
|
||
// GetParentDirAndLastEpoch returns the parent directory and last epoch | ||
// GetParentDirAndLastEpoch returns the parent directory and last usable epoch for the full archive node |
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.
not necessary for the full archive
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.
done
lastEpoch, err := ldp.GetLastEpochFromDirNames(epochDirs, 0) | ||
if err != nil { | ||
return "", 0, err | ||
for index := range epochDirs { |
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.
a lot of duplicated code with L71. Can be one function that returns the parentDir, lastEpoch, latestDataFromStorage, err
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.
done
…dNetwork/elrond-go into fix-boot-from-storage-after-import
e614101
return parentDir, lastEpoch, err | ||
} | ||
|
||
func (ldp *latestDataProvider) getLastData() (storage.LatestDataFromStorage, string, uint32, error) { |
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.
👍
When startInEpoch is disabled, instead of failing immediately the bootstrap from storage if the last epoch db does not have the bootstrap data, try to use the previous epoch DB and go from there.