Skip to content

[discussion] Update how Snapshots are configured #4059

@0x009922

Description

@0x009922

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.

Metadata

Metadata

Assignees

Labels

EnhancementNew feature or requestconfig-changesChanges in configuration and start up of the Irohairoha2-devThe re-implementation of a BFT hyperledger in RUSTquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions