• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bedrock-kv / bedrock / 636fbf24aa77d1cdf493009601561d69b129aba0
82%

Build:
DEFAULT BRANCH: develop
Ran 26 Aug 2026 04:29PM UTC
Jobs 1
Files 217
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

26 Aug 2026 04:08PM UTC coverage: 78.478% (+0.02%) from 78.457%
636fbf24aa77d1cdf493009601561d69b129aba0

push

github

web-flow
Enforce the segment pool ceiling the recycler always documented (#211)

Closes bedrock-61c.3 (epic bedrock-61c).

`SegmentRecycler.check_in/2`'s docstring has always promised to delete a
returned segment when the pool is full. `max_available` was fetched,
threaded into `State`, and never compared against anything.

Steady state hides it — one checkout per roll and one check-in per trim
keeps the pool oscillating at the cap. A **trim burst** does not:
`trim_durable_segments/1` splits off every segment below a jumped
durability watermark and checks them all in back-to-back with no
intervening checkout, so the pool keeps each at `segment_size` for the
life of the worker. At the 64 MiB production size a ten-segment burst
pins 640 MiB that is never released.

### Changes
- at the cap, unlink the returned segment instead of pooling it
- reject `min_available >= max_available` at construction — with no
slack a checkout drops the pool to `max - 1`, the min-refill allocates a
replacement, and the check-in then unlinks, so every cycle costs an
allocation and recycles nothing. Silent degradation becomes a startup
error. (`recovery_test.exs` used exactly `1/1`; updated to `1/2`.)
- correct two specs that promised `:: :ok` — `check_in/2` can now fail
on the unlink

### Trade
A later burst re-allocates what an earlier one used to leave lying
around. A metadata-only `fallocate` is the right price for not pinning
the disk.

### Verification
2803 tests, 0 failures. Credo and dialyzer clean.

Adversarially audited by a cold agent, which confirmed delete-safety
(every returned file is closed first, and `rm` is path-equivalent to the
old `rename` for every reader) and that the tests are boundary-sensitive
— mutating `>=` to `>` fails two of them. It also surfaced two
pre-existing bugs, filed separately as bedrock-m7j and bedrock-20c.

7 of 7 new or added lines in 1 file covered. (100.0%)

6786 of 8647 relevant lines covered (78.48%)

1030.1 hits per line

Jobs
ID Job ID Ran Files Coverage
1 636fbf24aa77d1cdf493009601561d69b129aba0.1 26 Aug 2026 04:29PM UTC 217
78.48
GitHub Action Run
Source Files on build 636fbf24aa77d1cdf493009601561d69b129aba0
  • Tree
  • List 217
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 636fbf24 on github
  • Prev Build on develop (#6C58CD94...)
  • Next Build on develop (#328EFBB5...)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc