Background
Lease-read PR #549 uses Go's time.Now() for the lease wall-clock. This carries Linux CLOCK_MONOTONIC (rate-adjusted by NTP slew at up to 500 ppm = 0.05%). Worst-case slew error at the 700 ms lease window is ~0.35 ms — three orders of magnitude below the 300 ms leaseSafetyMargin.
Decision (deferred)
TiKV uses CLOCK_MONOTONIC_RAW (NTP-slew-immune). Adopting the same in elastickv would require dropping the time.Time API on the lease path and calling golang.org/x/sys/unix.ClockGettime(unix.CLOCK_MONOTONIC_RAW, &ts). Not worth the API churn at the current margin.
Re-open trigger
- Safety margin tightened below ~5 ms.
- Jepsen-style clock-strobe testing reveals lease violations attributable to NTP rate adjustment.
References: PR #549, docs/lease_read_design.md.
Background
Lease-read PR #549 uses Go's
time.Now()for the lease wall-clock. This carries LinuxCLOCK_MONOTONIC(rate-adjusted by NTP slew at up to 500 ppm = 0.05%). Worst-case slew error at the 700 ms lease window is ~0.35 ms — three orders of magnitude below the 300 msleaseSafetyMargin.Decision (deferred)
TiKV uses
CLOCK_MONOTONIC_RAW(NTP-slew-immune). Adopting the same in elastickv would require dropping thetime.TimeAPI on the lease path and callinggolang.org/x/sys/unix.ClockGettime(unix.CLOCK_MONOTONIC_RAW, &ts). Not worth the API churn at the current margin.Re-open trigger
References: PR #549,
docs/lease_read_design.md.