mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-04 10:12:28 +02:00
Merge bitcoin/bitcoin#33680: validation: do not wipe utxo cache for stats/scans/snapshots
c6ca2b85a3validation: do not wipe utxo cache for stats/scans/snapshots (Pieter Wuille)7099e93d0arefactor: rename `FlushStateMode::ALWAYS` to `FORCE_FLUSH` (Lőrinc) Pull request description: Revival of https://github.com/bitcoin/bitcoin/pull/30610#issuecomment-3432564955 with the remaining comments applied on top > Since #28280, the cost of a non-wiping sync of the UTXO cache is only proportional to the number of dirty entries, rather than proportional to the size of the entire cache. Because of that, there is no reason to perform a wiping flush in case the contents of the cache is still useful. > > Split the `FlushStateMode::ALWAYS` mode into a FORCE_SYNC (non-wiping) and a FORCE_FLUSH (wiping), and then use the former in `scantxoutset`, `gettxoutsetinfo`, snapshot creation. (slightly updated after #30214) ACKs for top commit: optout21: reACKc6ca2b85a3cedwies: reACKc6ca2b8(trivial) achow101: ACKc6ca2b85a3sedited: ACKc6ca2b85a3Tree-SHA512: f3525a85dc512db4a0a9c749ad47c0d3fa44085a121aa54cd77646260a719c71f754ec6570ae77779c0ed68a24799116f79c686e7a17ce57a26f6a598f7bf926
This commit is contained in:
@@ -246,10 +246,10 @@ $ python3 contrib/tracing/log_utxocache_flush.py $(pidof bitcoind)
|
||||
|
||||
```
|
||||
Logging utxocache flushes. Ctrl-C to end...
|
||||
Duration (µs) Mode Coins Count Memory Usage Prune
|
||||
730451 IF_NEEDED 22990 3323.54 kB True
|
||||
637657 ALWAYS 122320 17124.80 kB False
|
||||
81349 ALWAYS 0 1383.49 kB False
|
||||
Duration (µs) Mode Coins Count Memory Usage Flush for Prune
|
||||
2556340 IF_NEEDED 2899141 394844.34 kB False
|
||||
2005788 FORCE_FLUSH 2238117 310189.68 kB False
|
||||
2685 FORCE_FLUSH 0 262.24 kB False
|
||||
```
|
||||
|
||||
### log_utxos.bt
|
||||
|
||||
@@ -10,7 +10,7 @@ from bcc import BPF, USDT
|
||||
"""Example logging Bitcoin Core utxo set cache flushes utilizing
|
||||
the utxocache:flush tracepoint."""
|
||||
|
||||
# USAGE: ./contrib/tracing/log_utxocache_flush.py path/to/bitcoind
|
||||
# USAGE: ./contrib/tracing/log_utxocache_flush.py <pid of bitcoind>
|
||||
|
||||
# BCC: The C program to be compiled to an eBPF program (by BCC) and loaded into
|
||||
# a sandboxed Linux kernel VM.
|
||||
@@ -45,7 +45,8 @@ FLUSH_MODES = [
|
||||
'NONE',
|
||||
'IF_NEEDED',
|
||||
'PERIODIC',
|
||||
'ALWAYS'
|
||||
'FORCE_FLUSH',
|
||||
'FORCE_SYNC',
|
||||
]
|
||||
|
||||
|
||||
@@ -61,7 +62,7 @@ class Data(ctypes.Structure):
|
||||
|
||||
|
||||
def print_event(event):
|
||||
print("%-15d %-10s %-15d %-15s %-8s" % (
|
||||
print("%-15d %-12s %-15d %-15s %-8s" % (
|
||||
event.duration,
|
||||
FLUSH_MODES[event.mode],
|
||||
event.coins_count,
|
||||
@@ -88,7 +89,7 @@ def main(pid):
|
||||
|
||||
b["flush"].open_perf_buffer(handle_flush)
|
||||
print("Logging utxocache flushes. Ctrl-C to end...")
|
||||
print("%-15s %-10s %-15s %-15s %-8s" % ("Duration (µs)", "Mode",
|
||||
print("%-15s %-12s %-15s %-15s %-8s" % ("Duration (µs)", "Mode",
|
||||
"Coins Count", "Memory Usage",
|
||||
"Flush for Prune"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user