Skip to content

Compaction has no I/O budget: a pass rewrites 300 MB per shard and starves the seal's barriers #94

Description

@PaulSnow

Invariant: 1.6, "the protocol path never waits for maintenance", and 1.2. With #92 closed, no maintenance runs on the protocol path; but the seal's fsync barriers still wait behind it in the device queue, and that is the store's cost to bound (2.7: bounded per pass).

Measured. Soak 20260916T185711Z, 60 minutes, bvn2-val4 bvnn store 5.9 GB: each shard's dynamic history is a 220 MB segment plus a 90 MB index behind a few small ones, so a fold rewrites ~300 MB per shard, ~2.4 GB per Compress per node. All four BVN2 nodes were streaming ~200 MB/s of reads and 60-80 MB/s of writes at once; I/O pressure (/proc/pressure/io full) 24-34%; a 4 KB fsync on the volume 16 ms p50 / 48 ms max; the host's dirty budget (vm.dirty_bytes 256 MB) full, so seal goroutines blocked inside write() of the manifest JSON. Twenty goroutine snapshots: seal shard goroutines in fsync 16 times and in throttled write() 11 times. BVN2's execution lag sat at 15-29, refusing all load; BVN1's nodes, not compacting at that moment, sat at lag 6.

CompactPassRecords bounds a pass by records (4 Mi; 32 Mi deep). It says nothing about bytes moved, and nothing about the rate at which they are moved relative to the commit path sharing the device.

Ask. A pass bounded by bytes as well as records, and paced: a rate limit on the merge's reads and writes (or a pass that yields between segments) so a fold costs the seal a bounded wait. A seal-duration histogram (accumulate #4257 asks for it) so the wait is displayed, not inferred from goroutine dumps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions