Page MenuHomePhabricator

coins: warn on shutdown for big UTXO set flushes
ClosedPublic

Authored by PiRK on Oct 14 2025, 13:12.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCdfe46e814509: coins: warn on shutdown for big UTXO set flushes
Summary

Setting a large -dbcache size postpones the index writes until the coins cache size exceeds the specified limit.
This causes the final flush after manual termination to seemingly hang forever (e.g. tens of minutes for 20 GiB);
Now that the dbcache upper cap has been lifted (D18577), this will become even more apparent, so a warning will be shown when large UTXO sets are flushed (currently >1 GiB).

Note that the related BCLog::BENCH units were also converted to KiB from kB to unify the bases.

Co-authored-by: Cory Fields <cory-nospam-@coryfields.com>

This is a backport of core#31534

Test Plan

ninja all check-all
.

$ src/bitcoind -reindex-chainstate -stopatheight=400000 -assumevalid=000000000000000004ec466ce4732fe6f1ed1cddc2ed4b328fff5224276e3f6f -datadir=/data0/ecashd_test -dbcache=1050
...
2025-10-14T13:09:25Z UpdateTip: new best=00000000000000003eb6d23ca5ba8d7a59b441fe40933869c1fc48d6088711dd height=276413 version=0x00000002 log2_work=75.041744 tx=29727290 date='2013-12-22T17:11:38Z' progress=0.029442 cache=1088.9MiB(8632368txo)
^C2025-10-14T13:09:25Z tor: Thread interrupt
...
2025-10-14T13:09:30Z [warning] Flushing large (1 GiB) UTXO set to disk, it may take several minutes
2025-10-14T13:09:35Z Shutdown: done

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Oct 14 2025, 13:12
Fabien requested changes to this revision.Oct 14 2025, 14:15
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/validation.cpp
2686 ↗(On Diff #56172)

don't use KiB here, it's wrong. It's divided by 1000 not 1024

This revision now requires changes to proceed.Oct 14 2025, 14:15

i missed a change in the coins mem usage conversion ( / 1000 becomes >> 10)

This revision is now accepted and ready to land.Oct 14 2025, 14:45