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

[discussion] Update how Snapshots are configured #4059

Closed
Tracked by #392
0x009922 opened this issue Nov 17, 2023 · 0 comments
Closed
Tracked by #392

[discussion] Update how Snapshots are configured #4059

0x009922 opened this issue Nov 17, 2023 · 0 comments
Assignees
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

Comments

@0x009922
Copy link
Contributor

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:

  • Instead of creation_enabled flag, use a parameter called mode and use a enum value for it:
    • normal (try to read on startup and update periodically, current behaviour with creation_enabled = true)
    • read (only try to read on startup, current behaviour with creation_enabled = false)
    • disabled (do nothing at all)
  • Instead of having 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.
@0x009922 0x009922 added Enhancement New feature or request question Further information is requested iroha2-dev The re-implementation of a BFT hyperledger in RUST config-changes Changes in configuration and start up of the Iroha labels Nov 17, 2023
@0x009922 0x009922 self-assigned this Mar 11, 2024
mversic pushed a commit that referenced this issue Mar 14, 2024
Signed-off-by: Dmitry Balashov <43530070+0x009922@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant