HomePhabricator

validation, log: improve logging of ChainstateManager snapshot persistance

Description

validation, log: improve logging of ChainstateManager snapshot persistance

Summary:
Use the LOG_TIME_MILLIS_WITH_CATEGORY_MSG_ONCE macro to improve the logging of ChainstateManager snapshot persistance, log task start and completion separately and no longer manually track the duration, as suggested by Marco Falke.

Extract the flushing into one function, which clarifies the logic, extends the improved logging to both flushing call sites, and allows logging the prefix FlushSnapshotToDisk, which is similar to FlushStateToDisk.

before

[snapshot] flushing coins cache (0 MB)... done (0.00ms)

[snapshot] flushing snapshot chainstate to disk

after

FlushSnapshotToDisk: flushing coins cache (0 MB) started
...
FlushSnapshotToDisk: completed (0.00ms)

FlushSnapshotToDisk: saving snapshot chainstate (0 MB) started
...
FlushSnapshotToDisk: completed (0.00ms)

This is a backport of core#23738

Depends on D12469

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Jon Atack <jon@atack.com>Authored on Dec 10 2021, 16:12
PiRKCommitted on Nov 11 2022, 03:31
PiRKPushed on Nov 11 2022, 03:31
Reviewer
Restricted Project
Differential Revision
D12470: validation, log: improve logging of ChainstateManager snapshot persistance
Parents
rABCe58399eaf2be: log: improve checkaddrman logging with duration in milliseconds
Branches
Unknown
Tags
Unknown