A time daemon steps a server's clock back by 400 ms at 09:30. The server writes an order log stamped from the system clock and computes fill latencies as the difference of two such stamps. State every failure this causes and the change that removes all of them.

A time daemon steps a server's clock back by 400 ms at 09:30. The server writes an order log stamped from the system clock and computes fill latencies as the difference of two such stamps. State every failure this causes and the change that removes all of them.

Approach: Separate the two uses a program makes of a clock, naming an instant and measuring an interval, then ask which of them a clock that can be stepped is able to serve.

Measure every duration with a monotonic clock, keep the wall clock only as a label, and stamp each record with a sequence number so ordering never depends on time at all. A backward step of 400 ms breaks four things at once. Durations taken as the difference of two wall clock reads come out short or produce a negative interval, so a fill latency histogram gains impossible values and every percentile from it is wrong for the session. Log ordering stops being monotonic, so a reader sorting by stamp reorders 400 ms of events and any reconstruction of which order was acknowledged first is wrong. Stamps repeat, so a key of (symbol, timestamp) collides and a dedup rule silently drops genuine records. And any timeout implemented as a comparison against the wall clock fires 400 ms early or late, which on a cancel timeout leaves live orders resting longer than intended. A monotonic clock never steps and never goes backwards, so it is the correct source for an interval. Configure the daemon to slew rather than step during trading hours, keep stepping for the maintenance window, and record both stamps on every record so a later analysis can detect the correction rather than be corrupted by it.

Follow-up: How do you merge two servers' logs into one ordered sequence when only one of them was stepped?

Key concepts: monotonic clock, wall clock step, negative interval, log ordering.