HomePhabricator

validation: remove snapshot datadirs upon validation failure

Description

validation: remove snapshot datadirs upon validation failure

Summary:

add utilities for deleting on-disk leveldb data

Used in later commits to remove leveldb directories for

  • invalid snapshot chainstates, and
  • background-vaildation chainstates that have finished serving their purpose.

https://github.com/bitcoin/bitcoin/pull/25667/commits/34d159033106cc595cfa852695610bfe419c989c

validation: remove snapshot datadirs upon validation failure

If a UTXO snapshot fails to validate, don't leave the resulting datadir
on disk as this will confuse initialization on next startup and we'll
get an assertion error.

https://github.com/bitcoin/bitcoin/pull/25667/commits/ad67ff377c2b271cb4683da2fb25fd295557f731

This is a partial backport of core#25667
Depends on D14653

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14654

Details

Provenance
James O'Beirne <james.obeirne@pm.me>Authored on Apr 29 2022, 13:02
PiRKCommitted on Oct 26 2023, 11:32
PiRKPushed on Oct 26 2023, 11:32
Reviewer
Restricted Project
Differential Revision
D14654: validation: remove snapshot datadirs upon validation failure
Parents
rABC26b3b6bfd4aa: test: add reset_chainstate parameter for snapshot unittests
Branches
Unknown
Tags
Unknown