Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

immediately return created snapshot in irreversible mode #7172

Merged
merged 2 commits into from
Apr 20, 2019

Conversation

arhag
Copy link
Contributor

@arhag arhag commented Apr 19, 2019

Change Description

PR #7119 made changes to the create_snapshot RPC of the producer_plugin to wait until the created snapshot becomes final (i.e. the block for which the snapshot was taken becomes irreversible) before returning the final path of the snapshot to the caller. This means blocks need to continue to be produced on the blockchain network for LIB (last irreversible block) to advance past the block for which the snapshot was taken, otherwise the create_snapshot RPC will forever hang.

The new behavior of create_snapshot implemented in PR #7119 works okay with the new irreversible enabled in PR #6624, if blocks are being produced. However, if it is in irreversible mode, create_snapshot should be able to immediately return with the final snapshot path even if there are no further blocks produced. This PR makes changes to make that happen.

This PR also includes a small change to create the snapshots directory if it doesn't already exist.

Consensus Changes

  • Consensus Changes

API Changes

  • API Changes

/v1/producer/create_snapshot

This endpoint now again returns immediately with the snapshot path when the node is in irreversible read mode. It still maintains the delayed return behavior introduced in #7119 when in a read mode other than irreversible.

Documentation Additions

  • Documentation Additions

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants