HomePhabricator

index: Commit DB_MUHASH and DB_BEST_BLOCK to disk together

Description

index: Commit DB_MUHASH and DB_BEST_BLOCK to disk together

Summary:
If these are written to disk at different times unclean shutdowns can lead to index corruption.

Add coinstatsindex_unclean_shutdown test

This is a backport of core#24138
Depends on D13912

Notes:

  • since D2127 removed the block index as an output parameter of AcceptBlock, we need some additional code in the test to fetch it from the block index.
  • src/test/util/validation.{h|cpp} need to be created since we didn't yet backport core#20332

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Martin Zumsande <mzumsande@gmail.com>Authored on Jan 24 2022, 13:34
PiRKCommitted on May 18 2023, 07:59
PiRKPushed on May 18 2023, 07:59
Reviewer
Restricted Project
Differential Revision
D13913: index: Commit DB_MUHASH and DB_BEST_BLOCK to disk together
Parents
rABC04c0b1b85da8: index: Avoid async shutdown on init error
Branches
Unknown
Tags
Unknown