Skip to content

Snapshot export status/stop #6082

@LesnyRumcajs

Description

@LesnyRumcajs

Snapshot Service

One of Forest's strong suits is its snapshot export performance. The API is mostly taken from Lotus, with some minor changes. Now, with the complexity of archival snapshot generation, we could add additional features to facilitate this.

  1. Snapshot generation progress: check that an export is in progress, and if so, return the progress (percentage) of the snapshot generation. As a CLI command, this could also allow for waiting until the snapshot generation is complete, continuously printing the progress.
  2. Snapshot generation cancellation: allow cancelling a snapshot generation in progress.

With that in mind, we could have the following CLI commands:

# regular snapshot export, semi-compatible with Lotus. It waits for it to complete, printing progress (effectively doing the `forest-cli snapshot export-status --wait` command internally)
forest-cli snapshot export 
sequenceDiagram
    participant CLI
    participant Forest

    CLI->>Forest: Request snapshot export
    CLI->>Forest: Poll export-status (internal)
    loop Until complete
        Forest-->>CLI: Progress %
    end
    Forest-->>CLI: Export completed
Loading
# check the status of a snapshot export
forest-cli snapshot export-status

# check the status of a snapshot export, waiting until it completes and printing progress
forest-cli snapshot export-status --wait
sequenceDiagram
    participant CLI
    participant Forest

    CLI->>Forest: Query export status (--wait)
    loop Until complete
        Forest-->>CLI: Progress %
    end
    Forest-->>CLI: Export completed
Loading
# cancel a snapshot export
forest-cli snapshot export-cancel
sequenceDiagram
    participant CLI
    participant Forest

    CLI->>Forest: Cancel snapshot
    Forest-->>CLI: Confirm cancellation
Loading

Metadata

Metadata

Assignees

Labels

Type: RequestRequests to implement features or make other changes

Type

No type

Projects

Status

In review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions