SourceStalecollected in 6m

Why Google Smears the Leap Second

Read original on 虎嗅
#time-synchronization#distributed-systems#cloud-infrastructure#leap-second

Leap-second handling can silently break distributed AI jobs, leases, logs, and cross-cloud coordination.

30-Second TL;DR

What Changed

Leap seconds can break POSIX time assumptions, timestamp ordering, locks, timers, and distributed database consistency.

Why It Matters

AI infrastructure depends on reliable timestamps for distributed training, job scheduling, observability, leases, and database coordination. Inconsistent cloud smear policies can create subtle ordering and reconciliation bugs in multi-cloud AI platforms.

What To Do Next

Audit your AI services for wall-clock usage, replace interval calculations with monotonic clocks, and document the cloud provider's leap-second smear policy.

Who should care:Developers & AI Engineers

Key Points

  • •Leap seconds can break POSIX time assumptions, timestamp ordering, locks, timers, and distributed database consistency.
  • •Google gradually slows clock frequency around a leap second so systems never observe 23:59:60 or a backward time jump.
  • •AWS, Google, Meta, and Microsoft use different smear windows or curves, creating cross-provider time discrepancies.
  • •The 2022 CGPM resolution aims to eliminate leap seconds from UTC by 2035.

Deep Insight

AI-generated analysis for this event — not the original article.

Enhanced Key Takeaways

  • •The leap second was introduced in 1972 by the International Bureau of Weights and Measures (BIPM) to reconcile atomic time (TAI) with Earth's rotation (UT1), but it has become increasingly problematic for high-frequency trading and distributed computing.
  • •Google's 'smear' implementation is specifically applied to their Network Time Protocol (NTP) servers, which serve time to Google Cloud instances and internal infrastructure, rather than modifying the hardware clock directly.
  • •The 2022 CGPM resolution (Resolution 4) mandates that the maximum difference between UTC and UT1 be increased from 0.9 seconds to at least 1 minute by 2035, effectively rendering the leap second obsolete for standard timekeeping.
  • •Meta (Facebook) proposed an alternative approach called 'Leap Smearing' in 2011, which influenced the industry-wide adoption of spreading the leap second over a 24-hour period to avoid the 'negative leap second' problem.
  • •The primary technical risk of leap seconds is the 'negative leap second' scenario, where a clock would need to jump from 23:59:58 to 00:00:00, skipping 23:59:59, which many legacy software systems are not designed to handle.

Competitor Analysis

Smear Window
Google (GCP)
24 hours (12h before/after)
AWS
24 hours (12h before/after)
Meta
17 hours
Microsoft (Azure)
24 hours (12h before/after)
NTP Offset
Google (GCP)
Linear
AWS
Linear
Meta
Linear
Microsoft (Azure)
Linear
Compatibility
Google (GCP)
Google-specific
AWS
AWS-specific
Meta
Internal/Open Source
Microsoft (Azure)
Azure-specific

Technical Deep Dive

  • Google's NTP servers adjust the frequency of the clock by a small amount, typically around 13.9 microseconds per second, to achieve a 1-second shift over 24 hours.
  • The smear is applied symmetrically, starting 12 hours before the leap second and ending 12 hours after, ensuring the total time accumulated remains consistent.
  • Systems using Google's time service do not see the leap second event; they see a slightly slower clock rate, which prevents the 'time jump' that causes database transaction failures.
  • The implementation relies on the NTP 'step' and 'slew' mechanisms, where the 'slew' mode is used to gradually adjust the clock frequency without discontinuities.

Future ImplicationsAI analysis grounded in cited sources

Leap seconds will be officially discontinued by 2035.
The 27th General Conference on Weights and Measures (CGPM) passed a resolution to stop adding leap seconds to UTC by 2035, shifting the burden of Earth's rotation variance to larger, less frequent adjustments.
Distributed systems will see reduced clock synchronization errors.
Standardizing on a continuous time scale (UTC without leap seconds) eliminates the need for complex, provider-specific smearing logic in cross-cloud distributed databases.

Timeline

1972-01
Introduction of the leap second to align UTC with Earth's rotation.
2011-06
Google first implements the 'leap smear' technique to handle the June 2012 leap second.
2012-07
Major internet outages occur due to leap second bugs in Linux kernels and Java applications.
2017-01
Google refines its smear implementation to be more robust for distributed systems.
2022-11
The 27th CGPM adopts Resolution 4 to eliminate the leap second by 2035.

Weekly AI Recap

Read this week's curated digest of top AI events →

AI-curated news aggregator. All content rights belong to original publishers.
Original source: 虎嗅 ↗

This is a summary, not the original. Read the source, or get the weekly briefing.

The weekly digest

One email a week. Unsubscribe anytime.