Skip to content

Move the matrixraft pin from 2c6929a to 70ff96f - #636

Merged
matrixarkai merged 1 commit into
mainfrom
chore/move-matrixraft-to-its-current-main
Nov 14, 2026
Merged

matrixarkai merged 1 commit into
mainfrom
chore/move-matrixraft-to-its-current-main

Conversation

@matrixarkai

@matrixarkai matrixarkai commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

What

Moves the matrixraft pin from 2c6929a to 70ff96f, matrixraft's current main. The pin was 119 commits behind. No source change in this repository.

What comes with it that this repository can feel

  • One fsync per write instead of two. A Ready that only advances the commit index is now written without a barrier of its own. After a crash a restart can find the stored commit index one write behind and recomputes it; an acknowledged entry is never lost this way. A clean reopen is unchanged.
  • Cold log reads go to their records. A read of the log no longer re-validates every record in the journal; it validates the records it touches, and every record is still validated in full the first time it is read. Damage to a record no read has touched is found at reopen, or on demand with the new PeerLogReader::verify.
  • A table-driven CRC-32C replaces two bit-at-a-time copies (file checksums and the binary WAL frame check).
  • New opt-in APIs this repository does not call yet: set_flushed_index and trim_log_to (both refused for peers with durable membership, which the metadata and chunk consensus here use), set_early_packet_sink, closest_follower / transfer_leadership_to_closest, persisted_wal_barriers / persisted_wal_records, and PeerTuning::wal_preallocate_bytes. Nothing here changes behaviour until something calls them.

Verified

On this branch with --all-features:

check result
cargo check --all-targets clean, no API breakage
cluster library tests (222) 222 passed, 0 failed, 7 ignored
chunk_membership_controller 3 passed
star repair after a metadata failover passed
three_dynamic_groups_rejoin_removed_voters_across_three_rounds passed
three_dynamic_groups_replace_voters_during_reads_and_recover passed
three_dynamic_groups_replace_voters_concurrently_during_reads_and_recover passed
star_repaird binary tests passed

Measured end to end (added after the merge)

This repository's own network_chunk_consensus fixture starts three chunkserver processes with raft over TCP and a real WAL fsync on every replica. A scratch test that is not part of this change timed 200 sequential replicated 256-byte writes through the leader, 16 interleaved runs per variant, alternating which variant went first, each variant launching its own chunkserver (the two binaries were checked to differ before any run).

median per write faster in paired runs
this pin (70ff96f) 12.5 ms 14 of 16
previous pin (2c6929a) 17.6 ms 2 of 16

That is about 1.4x. The two losses were the first two runs, taken while the machine was under heavy I/O pressure with other builds running; the next ten pairs were all wins.

Caveats: a debug build; one disk shared with other work, whose I/O pressure drifted upward during the session (the absolute figures rose with it, which is why the runs were interleaved); sequential writes from a single client; one fixture. The single-voter matrixraft figure of about 2x does not carry over unchanged, because a replicated write also pays the network and the client round trips.

Lockfile

Besides the matrixraft entry, the lock adds the dependency edge matrixraft -> rustix (Linux only; rustix 1.1.5 was already in the tree through tempfile) and moves three Windows-only transitive dependency entries from windows-sys 0.52.0 to 0.61.2, which cargo chose while re-resolving. The windows-sys moves do not affect Linux builds.

🤖 Generated with Claude Code

The pin is 119 commits behind matrixraft's main. Move it, so this
repository builds against the durable peer as it is now.

Cargo.lock moves the matrixraft entry, adds the one new dependency edge
it brings (rustix, Linux only, already in the tree through tempfile),
and moves three Windows-only transitive dependency entries from windows-sys
0.52.0 to 0.61.2, which cargo chose while re-resolving.

cargo check --all-features --all-targets is clean, the 222 cluster
library tests pass, and so do the metadata and chunk consensus tests
CI runs: the membership controller, star repair after a metadata
failover, and the three dynamic-group tests that replace and rejoin
voters.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@matrixarkai
matrixarkai merged commit c835032 into main Nov 14, 2026
5 checks passed
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.

2 participants