๐ŸฏFreshcollected in 6m

Why Google Smears the Leap Second

PostLinkedIn
๐ŸฏRead original on ่™Žๅ—…

๐Ÿ’ก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.

๐Ÿ”‘ 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โ–ธ Show
FeatureGoogle (GCP)AWSMetaMicrosoft (Azure)
Smear Window24 hours (12h before/after)24 hours (12h before/after)17 hours24 hours (12h before/after)
NTP OffsetLinearLinearLinearLinear
CompatibilityGoogle-specificAWS-specificInternal/Open SourceAzure-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 โ†’

๐Ÿ‘‰Related Updates

AI-curated news aggregator. All content rights belong to original publishers.
Original source: ่™Žๅ—… โ†—

Why Google Smears the Leap Second | ่™Žๅ—… | SetupAI | SetupAI