HomePhabricator

[Chronik] Fix `catch_merge_errors` by keeping intermediate results

Description

[Chronik] Fix catch_merge_errors by keeping intermediate results

Summary:
The current catch_merge_errors function is insufficient, for the following reason:

  1. When using merge_cf, it seems like RocksDB applies them on the fly for potentially many values, even if they've been read (and thus applied) before already.
  2. This means that a previous successful call to merge_cf would be reverted by the old catch_merge_errors, as any failed merge op would cause all previous successful applications to be discarded, causing a sort-of spooky removal action at a distance.

The solution is to keep previous successful applications of merge operands and to return the value from just before the error occured as the result of the merge function.

Test Plan: ninja check-crates && ninja check-functional

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Sep 19 2023, 16:40
tobias_ruckPushed on Sep 29 2023, 10:47
Reviewer
Restricted Project
Differential Revision
D14505: [Chronik] Fix `catch_merge_errors` by keeping intermediate results
Parents
rABC1e5fcb2579f9: [electrum] use a WaitingDialog to resolve aliases
Branches
Unknown
Tags
Unknown