[discussion] Update how Snapshots are configured #4059
Labels
config-changes
Changes in configuration and start up of the Iroha
Enhancement
New feature or request
iroha2-dev
The re-implementation of a BFT hyperledger in RUST
question
Further information is requested
Description
The current way the snapshots system is configured confuses me, and I propose to make this part clearer.
Current Design
Snapshots are configured with these parameters:
creation_enabled
(boolean, set by default)create_every_ms
(number)dir_path
(string, same as default Kura storage path)When creation is enabled, Iroha tries to read a snapshot on startup to quickly restore the WSV. Then Iroha periodically re-writes the snapshots.
When creation is disabled, Iroha still tries to read a snapshot on startup, but doesn't periodically update it.
There is no way for users to disable snapshots mechanism entirely. For example, one might want to disable even reading an existing snapshot at all. If they need to do so, they have to discover the path to the snapshot file (which is not documented) and remove it so that Iroha will not recover its WSV from the file.
Proposal
I propose to give users clearer control over snapshots by doing the following:
creation_enabled
flag, use a parameter calledmode
and use a enum value for it:normal
(try to read on startup and update periodically, current behaviour withcreation_enabled = true
)read
(only try to read on startup, current behaviour withcreation_enabled = false
)disabled
(do nothing at all)dir_path
defaulted to the same directory as Kura storage path (i.e../storage
), use a different default value, e.g../storage/snapshots
. IMO it will give a little better opportunity for users to remove the snapshots by themselves: just remove./storage/snapshots
directory, without research of which files in./storage
belong to storage and which to snapshots.The text was updated successfully, but these errors were encountered: