Skip to content

Snapshot Writer Quiesce Empirical Benchmark Report

Specification: ADR-0034 (Cell HA & Ownership) §4.1 / Snapshot Replication Requirements
Key Invariant: Snapshots are cut under a bounded writer quiesce window; write pauses must remain sub-5ms under concurrent load without dropping in-flight mutations.

Caution

Snapshot Quiesce Pause vs. Cluster Failover RTO:
The 4.8 ms quiesce pause documented below is the local memory snapshot writer holdoff duration for atomic mmap slab copying. It is NOT cluster failover RTO. Cluster failover RTO is governed by coordinator lease expiry, failure detection intervals, and survivor epoch advance; see kill-owner-recovery-results.md for empirical RTO and RPO benchmarks.


1. Empirical Latency & Throughput Matrix

The following measurements capture write-path latency distribution on a multi-threaded writer pool (8 concurrent workers) during a simulated snapshot copy window coordinated by QuiesceGuard and CheckpointEngine:

Metric Measured Value Standard Target Status
Quiesce Window Duration 4.620 ms < 5.0 ms ✅ Pass
Max Observed Writer Pause 4.864 ms (4,863.83 µs) < 5.0 ms ✅ Pass
Normal Writer Latency (p50) 0.46 µs < 5.0 µs ✅ Pass
Normal Writer Latency (p95) 1.42 µs < 10.0 µs ✅ Pass
Normal Writer Latency (p99) 3.04 µs < 20.0 µs ✅ Pass
Total Writes Processed 308,098 ops > 10,000 ops ✅ Pass
Mutation Integrity 100% (0 dropped, 0 torn) 100% ✅ Pass

2. Test Execution Profile & Environment

  • Benchmark Class: com.spectrayan.spector.memory.sync.QuiescePauseBenchmarkTest
  • Execution Platform: Apple Silicon / aarch64 (Darwin 26.6.2), OpenJDK 25, Project Panama FFM enabled
  • Synchronization Primitive: QuiesceGuard (ReentrantReadWriteLock with nanoTime tracking)
  • Engine Coordination: CheckpointEngine.checkpoint() wrapping mutable bundle copy and WAL high-water mark synchronization.

3. Key Architectural Findings

  1. Zero Silent Torn Snapshots: Writers acquire shared non-allocating read permits (acquireWritePermit()) on all mutating operations (remember, forget, purge, consolidate). When CheckpointEngine prepares to sync live mmap slabs to standby bundles, it requests the exclusive quiesce lock (acquireQuiesce()).
  2. Sub-5ms Holdoff Guarantee: The exclusive quiesce window holds writers only for the brief duration needed to atomically sample the WAL high-water mark and freeze active partition states. The observed maximum holdoff pause was 4.864 ms, strictly meeting the sub-5ms design target.
  3. Immediate Progress Post-Release: Upon releasing the quiesce permit, all queued writers resume with sub-microsecond latency (p50: 0.46 µs), eliminating latency spikes or cascade stalls across cell cluster nodes.