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

bedrock-kv / bedrock / abc99faa38a80b963c0a9f07a9c5aabb15b9a104
82%

Build:
DEFAULT BRANCH: develop
Ran 05 Sep 2026 03:49PM UTC
Jobs 1
Files 213
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

05 Sep 2026 03:48PM UTC coverage: 80.415% (+0.1%) from 80.317%
abc99faa38a80b963c0a9f07a9c5aabb15b9a104

push

github

web-flow
Prevent missing Olivine reads after right-edge page splits (#229)

## Why

Olivine routes a key through a tree whose boundaries are the last key on
each index page. Page 0 begins as the only page, but after the first
split it becomes the **leftmost** page.

When a key sorted beyond every stored boundary, the old fallback still
returned page 0. That sent new maximum keys back to the left edge,
creating overlapping page ranges and an out-of-order page chain. The
value bytes were written successfully, but point reads could route to
the wrong page and range reads could omit committed keys.

For example, after a split:

```text
page 0: a..f
page 1: g..m
```

A write for `z` must extend page 1. Sending it to page 0 produces
`a..f,z` before `g..m`, so the global index is no longer ordered.

The regression test reproduces this with 600 increasing keys written as
600 separate transactions, matching append-heavy metadata workloads.

## What changed

- Keys beyond the largest boundary now route to the page stored at
`:gb_trees.largest/1`, which is the actual rightmost page.
- Unit and property expectations now require routing to an existing
rightmost page rather than assuming page 0.
- Recovery validates the reconstructed index before accepting it:
  - page 0 exists;
  - map keys agree with embedded page IDs;
  - the page chain has no missing links or cycles;
  - every recovered page is reachable from page 0;
  - keys are globally ordered and unique across page boundaries;
- required version records exist and predecessor versions descend
correctly.
- Complete snapshots are validated before selective loading can hide
orphan pages.
- `IndexManager` restores the recovered data-file offset, and the index
analyzer reports structured corruption errors.

## How it works

### Routing new maximum keys

Normal lookups still choose the first page boundary greater than or
equal to the key. Only the no-boundary case changes:

```text
key e  -> boundary f -> page 0
key k  -> ... (continued)

63 of 68 new or added lines in 4 files covered. (92.65%)

3 existing lines in 2 files now uncovered.

7021 of 8731 relevant lines covered (80.41%)

1175.23 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
92.95
3.4% lib/bedrock/data_plane/materializer/olivine/index.ex
2
0.0
0.0% lib/mix/tasks/bedrock.analyze_index.ex

Coverage Regressions

Lines Coverage ∆ File
2
71.26
-2.3% lib/bedrock/data_plane/resolver/tree.ex
1
93.87
-0.61% lib/bedrock/data_plane/materializer/olivine/index_update.ex
Jobs
ID Job ID Ran Files Coverage
1 abc99faa38a80b963c0a9f07a9c5aabb15b9a104.1 05 Sep 2026 03:49PM UTC 213
80.41
GitHub Action Run
Source Files on build abc99faa38a80b963c0a9f07a9c5aabb15b9a104
  • Tree
  • List 213
  • Changed 7
  • Source Changed 0
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • abc99faa on github
  • Prev Build on develop (#B211A889...)
  • Next Build on develop (#930CBBAB...)
  • 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