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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
PR #7119 made changes to the
create_snapshot
RPC of theproducer_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 thecreate_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
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