Skip to content
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

Start snapshot after restart fix #4551

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

BeniaminDrasovean
Copy link
Contributor

@BeniaminDrasovean BeniaminDrasovean commented Oct 4, 2022

Description of the reasoning behind the pull request

  • If a snapshot is interrupted, when the node restarts it needs to start that snapshot again. The code that triggered that snapshot was on the constructor, thus triggering the same snapshot multiple times (each time the NewAccountsDB constructor is called)

Proposed Changes

  • Start the snapshot after restart on a separate method that is called only when is needed.

Testing procedure

  • Restart the node during a snapshot, and the snapshot should start only once.

@BeniaminDrasovean BeniaminDrasovean self-assigned this Oct 4, 2022
@iulianpascalau iulianpascalau self-requested a review October 4, 2022 09:47
@@ -384,6 +384,14 @@ func (nr *nodeRunner) executeOneComponentCreationCycle(
return true, err
}

selfId := managedBootstrapComponents.ShardCoordinator().SelfId()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please re-check this. On rc/v1.4.0 we do not have this call here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in rc/v1.4.0 these are called in the addSyncersToAccountsDB function after setting the trie syncers.

@@ -160,17 +154,16 @@ func checkArgsAccountsDB(args ArgsAccountsDB) error {
return nil
}

func startSnapshotAfterRestart(adb AccountsAdapter, args ArgsAccountsDB) {
tsm := args.Trie.GetStorageManager()
func startSnapshotAfterRestart(adb AccountsAdapter, tsm common.StorageManager, processingMode common.NodeProcessingMode) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked the file with v1.4.0, looks good 👍

return adb, nil
}

// StartSnapshotIfNeeded starts the snapshot if the previous snapshot process was not fully completed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checked with the rc/v1.4.0, looks good

@codecov-commenter
Copy link

Codecov Report

Base: 73.95% // Head: 73.91% // Decreases project coverage by -0.04% ⚠️

Coverage data is based on head (e732260) compared to base (3c1a1d6).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4551      +/-   ##
==========================================
- Coverage   73.95%   73.91%   -0.05%     
==========================================
  Files         681      681              
  Lines       87162    87170       +8     
==========================================
- Hits        64462    64432      -30     
- Misses      17883    17921      +38     
  Partials     4817     4817              
Impacted Files Coverage Δ
node/nodeRunner.go 0.00% <0.00%> (ø)
process/txsimulator/wrappedAccountsDB.go 69.38% <0.00%> (-1.45%) ⬇️
state/accountsDB.go 74.79% <0.00%> (-3.74%) ⬇️
state/accountsDBApi.go 93.85% <0.00%> (-0.84%) ⬇️
state/accountsDBApiWithHistory.go 91.91% <0.00%> (-0.94%) ⬇️
state/peerAccountsDB.go 88.75% <0.00%> (-2.72%) ⬇️
storage/txcache/txListBySenderMap.go 97.50% <0.00%> (-2.50%) ⬇️
p2p/libp2p/netMessenger.go 80.28% <0.00%> (+0.26%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@gabi-vuls gabi-vuls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System test passed.

@iulianpascalau iulianpascalau merged commit 0af5b6c into master Oct 4, 2022
@iulianpascalau iulianpascalau deleted the start-snapshot-on-restart-fix branch October 4, 2022 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants