Skip to content

query: in-flight is a load-thread map - #278

Merged
reardencode merged 4 commits into
masterfrom
store/inflight-load-map
Aug 26, 2026
Merged

query: in-flight is a load-thread map#278
reardencode merged 4 commits into
masterfrom
store/inflight-load-map

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

PR3 of the batch-parent-skeleton plan. Stacked on master after #275 (skeleton) and #277 (drain+fence drop).

  • Collapse InFlightLog / InFlightLayer / InFlightView to one InFlight HashMap (txid → fk, fk → CreatePin) with a height index for prefix/suffix drop.
  • Load thread owns the map. WireLoadPipeline borrows it. Insert after stamp so the current pack is invisible to that bind.
  • Prune predicate is unchanged from confirm: drop in-flight below lookup-wave drain+fence snapshot #277: lookup snapshots drain_and_fence_hi before TipOnly; load drops tagged packs with height below that snapshot after the last batch's in-flight read. Equality keeps (drain fk may sit mid-height). Disconnect still drop_from_height on pack height.
  • Delete layer-snapshot / make_mut isolation tests.

Live pause (do not merge until operator IBD)

  • iflight= occupancy comparable (height buckets, not exploding).
  • No parent create_fk unresolved.
  • Prune drops after a later wave's drain+fence snapshot is strictly above pack height.
  • Disconnect/reorg still clean.

Test plan

  • cargo test -p rbitcoin-query --lib -- in_flight stamp archive_plan inflight_binds
  • cargo test -p rbitcoin-consensus --lib -- bq_resolve stamp_uses_inflight pin_for_wire_incomplete
  • cargo test -p rbitcoin-net --lib -- prune_inflight marked_load_batch wire_prep_ahead confirm_engine_pins
  • cargo test -p rbitcoin-test --test scenarios -- wire_prep_ahead confirm_load_ahead
  • Required GitHub Actions green (fmt / deny / clippy / ast-grep / test / windows / macos / multinode / coverage)
  • Operator IBD occupancy / prune

Made with Cursor

rearden-grok Bot and others added 4 commits August 26, 2026 12:25
Replace InFlightLog/Layer/View with one HashMap (txid→fk, fk→CreatePin)
plus a height index. prune_below_height still drops strictly below the
#277 drain+fence snapshot; equality keeps because that height may be a
partial drain. Snapshot isolation is gone: load notes after stamp.

Co-authored-by: Cursor <cursoragent@cursor.com>
WireLoadPipeline holds &InFlight. Load notes the current pack after
stamp so that pack is invisible to bind, then prunes below the wave
drain+fence snapshot. Delete layer-snapshot tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Owner docs and occupancy copy match the HashMap + height-index model.
Prune is still pack height strictly below the lookup-wave drain+fence
snapshot; equality keeps.

Co-authored-by: Cursor <cursoragent@cursor.com>
WireLoadPipeline.in_flight and test ifo are already &InFlight.
Passing &&InFlight trips clippy::needless_borrow under -D warnings.

Co-authored-by: Cursor <cursoragent@cursor.com>
@reardencode
reardencode merged commit b3c1ddb into master Aug 26, 2026
13 checks passed
@rearden-grok
rearden-grok Bot deleted the store/inflight-load-map branch August 26, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant