Page MenuHomePhabricator

validation: remove snapshot datadirs upon validation failure
ClosedPublic

Authored by PiRK on Oct 19 2023, 14:14.

Details

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

Event Timeline

PiRK requested review of this revision.Oct 19 2023, 14:14

Tail of the build log:

.....
----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK
[179/482] Automatic MOC for target test_bitcoin-qt
[180/482] Building CXX object src/pow/test/CMakeFiles/test-pow.dir/grasberg_tests.cpp.o
[181/482] Linking CXX executable src/pow/test/test-pow
[182/482] pow: testing daa_tests
[183/482] Running utility command for check-pow-daa_tests
[184/482] Test Bitcoin utilities...
[185/482] pow: testing eda_tests
[186/482] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/parse_name_tests.cpp.o
[187/482] Running utility command for check-pow-eda_tests
[188/482] pow: testing grasberg_tests
[189/482] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/options_tests.cpp.o
[190/482] Running utility command for check-pow-grasberg_tests
[191/482] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/write_name_tests.cpp.o
[192/482] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/util_tests.cpp.o
[193/482] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/p2p_messaging_tests.cpp.o
[194/482] pow: testing aserti32d_tests
[195/482] Running utility command for check-pow-aserti32d_tests
[196/482] Running pow test suite
PASSED: pow test suite
[197/482] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/script_tests.cpp.o
[198/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/bitcoinaddressvalidatortests.cpp.o
[199/482] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/message_writer_tests.cpp.o
[200/482] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/__/wallet/test/wallet_tests.cpp.o
[201/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/test_bitcoin-qt_autogen/mocs_compilation.cpp.o
[202/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/compattests.cpp.o
[203/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/util.cpp.o
[204/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/guiutiltests.cpp.o
[205/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/uritests.cpp.o
[206/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/apptests.cpp.o
[207/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/rpcnestedtests.cpp.o
[208/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/test_main.cpp.o
[209/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/__/__/wallet/test/wallet_test_fixture.cpp.o
[210/482] Building CXX object src/seeder/test/CMakeFiles/test-seeder.dir/fixture.cpp.o
[211/482] Linking CXX executable src/seeder/test/test-seeder
[212/482] seeder: testing p2p_messaging_tests
[213/482] seeder: testing parse_name_tests
[214/482] seeder: testing options_tests
[215/482] seeder: testing message_writer_tests
[216/482] Running utility command for check-seeder-parse_name_tests
[217/482] Running utility command for check-seeder-options_tests
[218/482] Running utility command for check-seeder-p2p_messaging_tests
[219/482] seeder: testing write_name_tests
[220/482] Running utility command for check-seeder-message_writer_tests
[221/482] Running utility command for check-seeder-write_name_tests
[222/482] Running seeder test suite
PASSED: seeder test suite
[223/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/paymentservertests.cpp.o
[224/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/addressbooktests.cpp.o
[225/482] Building CXX object src/qt/test/CMakeFiles/test_bitcoin-qt.dir/wallettests.cpp.o
[226/482] Linking CXX executable src/qt/test/test_bitcoin-qt
[227/482] bitcoin-qt: testing test_bitcoin-qt
[228/482] Running bitcoin-qt test suite
PASSED: bitcoin-qt test suite
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1
PiRK planned changes to this revision.Oct 19 2023, 15:36
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/validation.cpp
5805
This revision is now accepted and ready to land.Oct 23 2023, 12:53