← Sun, Nov 15 digest

Strictly monotonic timestamps and gapless sequences in Rust

read article ↗ hn thread ↗

tsoracle is a Rust library and service providing distributed monotonic timestamps and gapless sequences using consensus drivers like Raft.

summary is enough The announcement introduces an intriguing Rust timestamp oracle, but the comment thread's sharp skepticism on gapless consistency provides essential critical context.

summary

tsoracle is a new Rust library and standalone service providing strictly monotonic timestamps and gapless sequences in distributed systems using consensus drivers like Raft or OmniPaxos. It achieves high throughput by having the leader fsync and replicate high-water marks, allowing nodes to hand out local batches. However, Hacker News commenters strongly question whether true gaplessness can be maintained across client crashes and batch allocation without introducing desyncs or centralization bottlenecks. The project includes production-ready drivers, fuzz testing, and a stress harness.

key points

  1. tsoracle issues both monotonic timestamps and gapless sequences backed by consensus engines like OpenRaft or OmniPaxos.
  2. Performance is scaled via local batching where a leader fsyncs and replicates a high-water mark before nodes distribute IDs.
  3. Commenters highlight major architectural tensions, specifically how client-side failures during batch usage can introduce un-reconciled gaps.

who should read it

Backend and distributed systems engineers working with Rust who need cross-machine event ordering or unique ID generation.

discussion skeptical

consensus

Commenters are broadly skeptical about combining high-throughput distributed batching with strict gaplessness, pointing out inevitable desync vectors when clients fail after receiving a batch.

pushback

A few note that for high-contention counters, a single centralized leader serializing requests is often sufficient and avoids unnecessary distributed complexity.

best comment by hansvm ↗

Something seems fishy here. What am I missing?

> no torn state

Doesn't there exist a failure mode where you allocate from a batch, fsync that you've done that allocation, the application fails to do anything with that counter, and you thereby introduce a gap in whichever "gapless" sequence you're trying to construct? The primitive exposed here might be able to be gapless, but the API doesn't look like it'll compose nicely into creating an application with the gapless property you're trying to enforce.

That desync between application state and tsoracle state seems more likely when you …

It breaks down the specific failure mode where allocated batches desync from application state, directly challenging the gapless guarantee.

Generated by an LLM from the article and thread. Check the sources before relying on it.