The Register® — Biting the hand that feeds IT

Feeds

Google reveals 'leap smear' NTP technique

Copes with problems of living on spinning space boulder

Requirements Checklist for Choosing a Cloud Backup and Recovery Service Provider

Google has to lie to computers in order not to upset them with the vagaries of earthly time.

The text-ads colossus has just written a blog post on how it adjusts its computer systems to deal with leap seconds – by lying to them a bit with a technique it calls "leap smear", where the search giant adds a few milliseconds bit by bit in the time period up to the leap second. It involves blurring time a bit – in a way that computers can deal with. Smart eh?

The Chocolate Factory talks us through the tech in a post on The Google Blog:

The solution we came up with came to be known as the 'leap smear'. We modified our internal Network Time Protocol [NTP] servers to gradually add a couple of milliseconds to every update, varying over a time window before the moment when the leap second actually happens. This meant that when it became time to add an extra second at midnight, our clocks had already taken this into account, by skewing the time over the course of the day. All of our servers were then able to continue as normal with the new year, blissfully unaware that a leap second had just occurred.

Leap days come once every four years, but leap seconds get added on as and when we need them – there have been 24 since 1972 – and make up for the inconsistencies in the length of the earthly year. Inconsistencies that come from being an earthquake-troubled irregularly-shaped spinning piece of rock orbiting its star 150 million kilometers (93 million miles) away.

Since 1972, timekeepers have added (or subtracted) an extra second at the end of a particular day once every few years, but as computer systems have become more complex, having a rogue extra second can cause a lot of trouble.

We can lie to the computer clock, but we can't lie to ourselves forever though. We're still little collections of carbon molecules spinning around on some rock in the abyss. What can we do about that, Google? Eh? Thought so. ®

Customer Success Testimonial: Recovery is Everything

150 million km

If the Earth covered 150 million km in it's attempt to orbit the sun, we'd be burnt to a crisp.

12
0

"What can we do about that, Google? Eh? "

Please, please don't tempt them.

10
0

@A curious solution

NTP works fine with this because it was designed by folk who know what are are doing.

The underlying problem is that computers (or more precisely their clocks and calendar libraries) *assume* time is always 24*60*60 seconds per day, so the time_t of UNIX (or the corresponding underlying linear system in Windows) has to be stepped by 1 sec when such an adjustment to UTC is made, and so calculations across the jump are wrong.

But the Earth day is not exactly this, and we have always had the convention that mid-day (for 0 longitude, etc) is mean solar crossing, so *something* has to be fudged.

It has been proposed not to correct UTC to be 'right' in an astronomical sense to get round this, because of the accumulated stupidity of computers. But why? Fix the computer's clocks or just get over it. No big deal, eh?

5
0

More from The Register

Reg hack prepares to live off wondergloop Soylent
Our man puts eating people powder Food 2.0 to the test
ROBOT COW teaches Saudi kids where milk comes from
Udderly ridiculous bovine intervention is beyond the pail
 breaking news
Who's to be the next Dr Who? Sherlock beats Maurice - says you
Cumberbatch EXTERMINATES Ayoade, Atkinson, Pegg - and Tilda Swinton
Chewbacca held up by TSA stormtroopers for having light sabre
'Mrauuun' 'Right, Chewie, giant man do need giant cane'
 breaking news
I told you I'd be back: Arnie set for another career revival
Don't worry voters, Schwarzenegger's talking about Terminator 5
Waving an Eye-of-Sauron pulsating mock cock? STOP IMMEDIATELY
Mains-powered sex aid recalled ... Ultimate O turns into ultimate OH NO
At #guardiancoffee, we can now TASTE THE FUTURE through a PRISM!
I have measured out my life in espresso spoons
Oracle's Ellison outlines plans for Hawaiian Electriclarryland
Solar-sourced eau d'Oracle the key to island revival
Soylent days and soylent nights
Food 2.0 fails the post-pub nosh test
BEYOND Marxism: What Google learned from staring Glassily at Norks
Boobs, Noobs and Juche-oriented networked facilitators