HomePhabricator

Simplify semantics of ChainStateFlushed callback

Description

Simplify semantics of ChainStateFlushed callback

Summary:
Previously, ChainStateFlushed would fire either if a full flush
completed (which can happen due to memory limits, forced flush, or
on its own DATABASE_WRITE_INTERVAL timer) *or* on a
ChainStateFlushed-specific DATABASE_WRITE_INTERVAL timer. This is
both less clear for clients (as there are no guarantees about a
flush having actually happened prior to the call), and reults in
extra flushes not clearly intended by the code. We drop the second
case, providing a strong guarantee without removing the periodit
timer-based flushing.

backport of second commit (9cb6cdc) from PR13106
Depends on D2927

Test Plan: make check and functional tests

Reviewers: #bitcoin_abc, deadalnix, Fabien

Reviewed By: #bitcoin_abc, Fabien

Maniphest Tasks: T632

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

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on May 20 2019, 23:18
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Committed on May 20 2019, 23:29
markblundebergPushed on May 20 2019, 23:29
Reviewer
Restricted Project
Differential Revision
D2928: Simplify semantics of ChainStateFlushed callback
Parents
rABC34964a601d4b: scripted-diff: Rename SetBestChain callback ChainStateFlushed
Branches
Unknown
Tags
Unknown

Event Timeline

Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com> committed rABCedb02081d31d: Simplify semantics of ChainStateFlushed callback (authored by Matt Corallo <git@bluematt.me>).May 20 2019, 23:29