Anche i più grandi tra i grandi…

Anche i più grandi tra i grandi…

…eh si, volano giù

Sono un Google-Lover. Da quando esiste, ho spostato tutte le mie applicazioni su Google App Engine. Non mi dilungo nei dettagli, ma la struttura fa impressione: scala senza il minimo problema, sia per quanto riguarda la parte web che la parte db/storage, e non ha i limite che ha Amazon AWS. Ho fatto diversi test sul servizio, se a qualcuno interessano potrei pubblicare un post descrivendone i risultati.

Torniamo al down: il 24 Febbraio stavo lavorando ad una mia applicazione basata su GAE, quando, intorno alle 17.00, tutte le richieste hanno iniziato a finire in timeout. Appena il tempo di realizzare (ho impiegato 30 minuti per convincermi che il servizio era veramente down) e il mio aggregatore mi segnala un nuovo post nel gruppo GAE Downtime Notify di Google in cui vengono pubblicate informazioni sui down previsti e su quelli un pò meno previsti. Sono circa le 17.30.

Il suo contenuto è:

Since 7:53am PST, App Engine has been experiencing an unexpected outage affecting the majority of App Engine applications.  The team is working quickly to correct the cause and will have an ETA on the fix shortly.

Please watch this thread for updates. We sincerely apologies for the inconvenience.

Il servizio rimane KO, e alle 18.30 circa ricevo un confortante aggiornamento:

We are still actively working on the on-going outage.  We’ve also experienced a problem with our backup datacenter. We will continue to provide status updates on this thread every thirty minutes.

Il messaggio mi informa che stanno lavorando al problema, ma che ci sono altri problemi con il datacenter secondario (su cui, probabilmente, avevano pianificato di swappare il traffico in caso di failure del primario).

Dopo altri 20 minuti, alle 18.50 (o qualcosa di simile) la mia applicazione riprende a rispondere, ma segnala che il DataStore è in read-only. Un nuovo post conferma quanto ho appena notato:

As of 9:48am, all applications should now be available in read-only mode.

Aspetto altri 20 minuti e tutto torna a funzionare normalmente, anche se in modo estremamente lento. Probabilmente -penso- sono partiti tutti i processi cron schedulati durante il down.

Arriva un nuovo update:

As of 10:09am, all application should be serving traffic and successfully reading/writing from the datastore.  Again, apologies for the inconvenience of the outage.  We will follow up with a post-mortem.

Per me si chiude qui, nel senso che dalle 19.30 più o meno, lentezza a parte, riprende a funzionare tutto. Per altri utenti no, Google infatti parla di problemi ancora presenti su “a small percentage of datastore entity groups”. Più tardi, in una rettifica, parleranno di problemi di inconsistenza del DataStore per circa 25 applicazioni.

La sera del 25 Febbraio (il giorno dopo) Google pubblica un aggiornamento:

We continue to work diligently in the wake of yesterday’s unforeseen App Engine outage on a number of issues, so we wanted to provide you an update with our current list of tasks.

– Applications will not be charged for any App Engine resource usage that occurred during Feb 24th, 2010.

– We are still working on fix for writes and transactional reads affecting a small number of datastore entity groups.  We have determined that approximately 25 application IDs have been affected by this issue.  If you feel you are having difficulties with certain entity groups in your application, please respond to this thread with your App ID.

– We are working hard on putting together a detailed post mortem that we will be making public.  We expect to have this available to you next week.

Again we sincerely apologize for yesterday’s service disruption.  We take App Engine’s reliability very seriously and we are confident we can use the hard lessons learned from yesterday’s event to improve our offering to you.

Attendo il post-mortem fino al 5 Marzo, quando, finalmente, ricevo la tanto attesa mail. Inizia con un riepilogo sul downtime:

On February 24th, 2010, all Googe App Engine applications were in varying degraded states of operation for a period of two hours and twenty minutes from 7:48 AM to 10:09 AM PT | 15:48 to 18:09 GMT.

The underlying cause of the outage was a power failure in our primary datacenter. While the Google App Engine infrastructure is designed to quickly recover from these sort of failures, this type of rare problem, combined with internal procedural issues  extended the time required to restore the service.

Parla di “internal procedural issues”, “problemi nelle procedure interne” meglio descritti poco sotto:

– Although we had procedures ready for this sort of outage, the oncall staff was unfamiliar with them and had not trained sufficiently with the specific recovery procedure for this type of failure.

– Recent work to migrate the datastore for better multihoming changed and improved the procedure for handling these failures significantly. However, some documentation detailing the procedure to support the datastore during failover incorrectly referred to the old configuration. This led to confusion during the event.

– The production team had not agreed on a policy that clearly indicates when, and in what situations, our oncall staff should take aggressive user-facing actions, such as an unscheduled failover.  This led to a bad call of returning to a partially working datacenter.

– We failed to plan for the case of a power outage that might affect some, but not all, of our machines in a datacenter (in this case, about 25%). In particular, this led to incorrect analysis of the serving state of the failed datacenter and when it might recover.

In breve (ed in italiano): lo staff oncall non era pronto a far fronte a questo tipo di problemi. La documentazione di supporto, si riferiva ad una versione obsoleta del sistema (e probabilmente totalmente incompatibile, perchè è stato recentemente aggiornato il sistema di replicazione del DS), e i tecnici che avrebbero dovuto iniziare il failover si sono trovati davanti a due procedure contrastanti senza sapere quale utilizzare.

I sistemi di controllo interni hanno poi segnalato come utilizzabile un datacenter che non lo era, poichè non erano studiati per considerare una perdita di alimentazione parziale e non totale. Lo staff, infine, dopo aver tentato, con esito negativo, di spostare il traffico in read-only sul datacenter secondario, ha deciso di girare di nuovo il tutto sul primario, credendo, erroneamente, che stesse tornando online.

Dalla cronologia, riportata in calce al post mortem,  scopro in dettaglio cosa è successo durante le due ore di down (riporto gli orari originali, tenete conto che noi siamo avanti di 9 ore):

Alle 7.48 si iniziano a riscontrare errori nel traffico servito dal DC primario. Alle 7.53 i “Google Site Reliabilty Engineers” segnalano che nel DC c’è stata una perdita di alimentazione, e che a causa di un problema con l’alimentazione secondaria circa il 25 % dei server sono in crash.

Alle 8.01 viene confermato che GAE è down. Viene deciso di darne comunicazione ufficiale agli utenti. Alle 8.22 viene confermato che diverse macchine non sono ripartite, e che il cluster GFS e BigTable non sono funzionanti a causa dell’alto numero di server persi. Si decide di avviare la procedura di failover verso il DC secondario.

Alle 8.40 viene scoperto un conflitto nella documentazione sulle procedure di failover. Non potendo decidere quale fosse la procedura da utilizzare, gli ingegneri decidono di contattare la persona responsabile del cambio di procedura. Alle 8.44, mentre una parte dello staff sta ancora lavorando alla procedura di failover, si tenta di servire il traffico in sola lettura dal DC primario. Un problema nella configurazione, però, impedisce al DC secondario di servire il traffico.

Alle 9.08, mentre parte dello staff sta tentando di risolvere il problema di configurazione nel DC secondario che impedisce di servire le richieste e un’altra parte sta ancora lavorando alla procedura di failover, il “Primary OnCall Engineer” ritenendo che il DC primario fosse tornato completamente operativo e pronto a servire tutte le richieste, avendo in mano dati dei sistemi di diagnosi che confermavano ciò, senza sapere però che non era mai usccesso prima che un DC dopo un danno simile tornasse utilizzabile, devia nuovamente il traffico su quest’ultimo, nel tentativo di far tornare online il servizio.

Alle 9.18 si rendono conto che il DC primario non è tornato online, e che non può servire il traffico. Si concentrano quindi gli sforzi sul DC secondario, si devia nuovamente lì tutto il traffico e si inizia la procedura di failover.

Alle 9.35 viene raggiunto un ingegnere con esperienza nella procedura e si inizia il failover. Alle 9.48 il DC secondario inizia a servire le richieste in read-only.

Alle 9.53 viene confermata la corretta procedura di failover per il read-write, e si avvia il processo.

Alle 10.09 il processo termina, ed il traffico riprende ad essere servito normalmente. Google App Engine da questo momento è considerato online.

Il post-mortem contiene anche una serie di correzioni che Google intende attuare per evitare il ripetersi di casi simili:

As a result, we have instituted the following procedures going forward:

– Introduce regular drills by all oncall staff of all of our production procedures. This will include the rare and complicated procedures, and all members of the team will be required to complete the drills before joining the oncall rotation.

– Implement a regular bi-monthly audit of our operations docs to ensure that all needed procedures are properly findable, and all out-of-date docs are properly marked “Deprecated.”

– Establish a clear policy framework to assist oncall staff to quickly and decisively make decisions about taking intrusive, user-facing actions during failures. This will allow them to act confidently and without delay in emergency situations.

We believe that with these new procedures in place, last week’s outage would have been reduced in impact from about 2 hours of total unavailability to about 10 to 20 minutes of partial unavailability.

In response to this outage, we have also decided to make a major infrastructural change in App Engine. Currently, App Engine provides a one-size-fits-all Datastore, that provides low write latency combined with strong consistency, in exchange for lower availability in situations of unexpected failure in one of our serving datacenters. In response to this outage, and feedback from our users, we have begun work on providing two different Datastore configurations:

– The current option of low-latency, strong consistency, and lower availability during unexpected failures (like a power outage)

– A new option for higher availability using synchronous replication for reads and writes, at the cost of significantly higher latency

We believe that providing both of these options to you, our users, will allow you to make your own informed decisions about the tradeoffs you want to make in running your applications.

Termina con delle scuse:

We sincerely apologize for the impact of Feb 24th’s service disruption on your applications. We take great pride in the reliability that App Engine offers, but we also recognize that we can do more to improve it. You can be confident that we will continue to work diligently to improve the service and ensure the impact of low level outages like this have the least possible affect on our customers.

Un down, prima o poi capita a tutti. Per quanto mi riguarda, rinnovo la mia fiducia nella grande G.

Giorgio

2 thoughts on “Anche i più grandi tra i grandi…

  1. Ma mi hai premoderato?
    Questo blog non è abbastanza intelligente da capire che sono IO? :D
    Ho messo la mail vera (da battaglia) questo giro, se mi arriva più spam di quella mezza tonnellata che filtro… ci siamo capiti.

  2. Si no premodero tutti perchè in realtà non ho mai voluto commenti, solo che poi erano più le mail che altro quindi li ho riabilitati ma sotto moderazione.

    Anche perchè quello che scrivo io NON SI COMMENTA.

    Giorgio

Leave a Reply to GiorgioCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.