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

System Can Be Halted Before The Snapshot Finishes #777

Closed
4 tasks done
tkxkd0159 opened this issue Nov 2, 2022 · 0 comments
Closed
4 tasks done

System Can Be Halted Before The Snapshot Finishes #777

tkxkd0159 opened this issue Nov 2, 2022 · 0 comments
Assignees
Labels
A: bug Something isn't working

Comments

@tkxkd0159
Copy link
Member

tkxkd0159 commented Nov 2, 2022

Summary of Bug

When calling the function Commit() from the BaseApp struct, the following piece of code will be executed

if halt {
	// Halt the binary and allow Tendermint to receive the ResponseCommit
	// response with the commit ID hash. This will allow the node to successfully
	// restart and process blocks assuming the halt configuration has been
	// reset or moved to a more distant value.
	app.halt()
}

if app.snapshotInterval > 0 && uint64(header.Height)%app.snapshotInterval == 0 {
	go app.snapshot(header.Height)
}

Note that when halt is set to be true, the shutdown process will start and eventually os.Exit(0) will be executed. In addition to this, if snapshot execution conditions are expected to be valid, the snapshot creation process will never be triggered even if those conditions are valid. In conclusion, according to the current implementation, system halting is not compatible with the snapshot process.

Version

17262932f550fbfb658e8f8bf4b66f023eaa3cdd

Discussion

Snapshots are separate binary files to help new nodes to bootstrap quickly as they join the network. (a.k.a. state-sync). It consists of LevelDB data and its metadata. The upstream's code still doesn't save snapshot before halt. This structure reduces consistency by failing to save the last-height snapshot when the chain halt, but it is not an important issue because snapshots do not affect the consistency of the chain itself, but just optional things for helping remote nodes. So we won't fix and follow upstream because of those reasons.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@tkxkd0159 tkxkd0159 added the A: bug Something isn't working label Nov 2, 2022
@tkxkd0159 tkxkd0159 self-assigned this Nov 2, 2022
@tkxkd0159 tkxkd0159 added wontfix A: bug Something isn't working and removed A: bug Something isn't working labels Nov 2, 2022
@tkxkd0159 tkxkd0159 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant