August 10th, 2008 — en, gsoc, python
I’ve been working on the task I described on my last post, about parallelizing request to multiple backends. After many time getting strange errors on the tests I got to isolate the problem - my code wasn’t handling the exceptions right.
ZEORaid considers ZODB.POSException.POSError and transaction.interfaces.TransactionError valid answers from storages, as they don’t indicate storage failure. The problem was that I was getting some ConflictErrors (a kind of TransactionError) that were being considered a sign of storage failure when running ZODB tests.
Christian helped me to work on hadling this and now all tests are passing. I’m just refactoring the code now and will procceed to the next task: allow defining/removing new backend storages while running using the client tool or reloading the config.
Published on July 18, 2008.
August 10th, 2008 — en, gsoc, python
In the beginning of this week I finished the tests for my last task and done some refactoring on it’s code. My main problem were to get a storage implementation to use on my tests; first I wrote a subclass of ZODB.DemoStorage.DemoStorage, but it wasn’t implementing the full API needed by ZEORaid. Christian said that I should change the base class to ZODB.FileStorage.FileStorage - a pretty trivial change to do, and it solved my problems. After that I fixed some things in the test (that was getting possible false alarms).
Finishing that I begin my current task: parallelizing requests to multiple backends. Basically what ZEORaid currently does when it needs to send write requests to multiple backends is:
- talk to backend a, wait for answer
- talk to backend b, wait for answer
- …
- proceed
What we want it to do is:
- send request to backend a
- send request to backend b
- send requests …
- wait for answers of all requests and proceed
Reading (briefly) the source code I’ve found 4 methods that loops the list of backends in the “optimal” state and make calls:
- new_oid
- _apply_all_storages
- _synchronise_oids
- _apply_single_storage
The first three methods could be changed to start len(self.storages_optimal) threads and make the work; then we could use join() to wait for all answers and proceed. About the 4th method, _apply_single_storage(), Christian said that “Distributing the read requests in parallel is a good idea too, but a bit less important than distributing the write requests. Serialized writes currently cause a lot of overhead and slowness and reading won’t benefit as much, so I’d leave apply_single_storage out of the story for now.”, so I will focus on parallelizing write requests first. He also said that should be some refactoring to have the looping/thread creation only once in the code.
This seems a bit more challenging than my last task (specially to test), which is great! I’m learning a lot about many things, and it’s been very fun :-).
Published on June 28, 2008.
August 10th, 2008 — en, gsoc, python
I had some problems this week (many exams and things to do on university), so this was a slow week on GSoC.
I worked on creating tests for my last week’s patches. Unfortunately I took the wrong direction, writing some code to monkeypatch the gocept.zeoraid.storage.RAIDStorage.__apply_single_storage() method to provide logging and see if the requests are being distributed; Christian later suggested that it should be better to write a simple storage implementation to avoid using monkeypatching (it doesn’t need to be a ClientStorage compatible storage, it just need to implement some needed methods such as gocept.zeoraid.tests.failingstorage.FailingStorage does).
Next week I will work on finishing this task and hopefully starting my next task - parallelize requests to multiple backends, probably.
Published on June 22, 2008.
August 10th, 2008 — en, gsoc, python
Martijn suggested that I should write periodic reports about my work on GSoC, so here we go.
My first task was to test if ZEORaid is processing validations from the backend storages too often. I’ve done some tests in different situations, and I haven’t found anything wrong yet. I have to put more work on this, but it will wait because there are more important things that need attention until the 1.0 release.
After that I’ve been working on distributing single requests to backends over the available (optimal) backends. Right now ZEORaid (trunk) iterates over a list of optimal storages and gets the first reliable result; I wrote a simple patch to distribute the requests randomly.
My current task is to provide supplemental tests to verify that the new changes actually apply as predicted (e.g. that reading actually does trigger requests to different backends).
Published on June 16, 2008.
August 10th, 2008 — en, gsoc, python
As most of you already know, my student application was accepted for the Google Summer of Code project. I will be working on gocept.zeoraid, package that provides a proxy storage that works like a RAID controller by creating a redundant array of ZEO servers. ZEORaid was created by Christian Theune from gocept, who is my mentor for this project.
I’m using the time left until the coding starts to learn how to use ZEORaid and how it’s code works. I’m very happy and excited with this project, and I’m already learning a lot with it.
Many thanks to everyone who helped me, and good luck for all fellow GSoC students!
Published on May 11, 2008.
August 10th, 2008 — pt-br, python
A PyConBrasil III reúne usuários e interessados na linguagem Python para alguns dias de palestras, treinamentos e confraternização. Este é um evento itinerante - já esteve em Campinas, Brasília e esse ano foi em Joinville / SC (poucas horas aqui de casa), nos dias 30 e 31 de agosto e 1o de setembro.
Um dia antes do começo do evento, dia 29/30, tivemos uma assembléia da Associação Python Brasil destinada à eleição da nova diretoria e de partes do conselho fiscal e do conselho deliberativo. Infelizmente, por causa do mau tempo e consequente fechamento dos aeroportos de Joinville e Curitiba, relativamente poucas pessoas estiveram presentes. Aliás, fui eleito por unanimida… OK, OK, por W.O., não tinha concorrência, para membro do conselho fiscal. Me disponibilizei como voluntário e espero poder ajudar no que for possível.
No primeiro dia do evento tivemos algumas palestras do pessoal da “firma”, inclusive uma palestra minha sobre Grok. Foi a primeira palestra que apresentei na vida, portanto está cheia das gafes comuns aos iniciantes, como vários “aaannnn…”, “bom, ” e corpo “travado”. Apesar dos pesares, fui bastante elogiado pelo conteúdo da palestra.
Detalhe importante: várias pessoas vieram falar comigo dizendo coisas como “CARACA, QUE CAMISETA HORRÍVEL!” ou “Ai meu filho, por quê você não usou uma daquelas camisetas pretas bonitas do evento?” (minha mãe, obviamente). Duas coisas:
- A camiseta não é *TÃO* feia assim, mas admito que a cor é meio berrante / bizarra demais. Poderia ser um laranja mais fraco, ou mesmo preto. Ah vá! Ela é bem legal :-);
- É uma camiseta do Grok, justamente o assunto da minha palestra. Eu fiquei feliz em fazer uma certa “propaganda”.
No mesmo dia tive a honra de poder ajudar o Luciano Ramalho na apresentação de um treinamento sobre Grok. No começo tivemos alguns problemas técnicos que foram muito chatos, como um proxy maluco (como todo proxy de universidade), instalação do python estranha e problemas no easy_install. Apesar disso conseguimos fazer um “workaround” (nome chique para “gambiarra”) com a ajuda do Rudá Porto para a coisa toda funcionar, depois foi bem divertido.
Menção honrosa à minha total inabilidade como inglês falado: meu inglês para leitura e escrita (e até para “audio”) é muito bom, não tenho problemas. Entretanto, no meio do treinamento o Nate Aune (da Jazkarta / Plone4Artists) me pediu algumas informações e, vergonhosamente, o máximo que consegui foi soltar uns monossilábicos e depois digitar algumas coisas para ele no notebook. Acho que fiquei meio “travado” por vergonha de errar algo na frente de alguém que fala inglês nativamente mas, bem, isso só tornou as coisas piores. Preciso voltar a praticar essa bagaça.
Como disse antes, o pessoal da Weimar Consultoria (empresa em que trabalho) apresentou várias palestras e treinamentos na PyConBrasil. Algumas palestras foram do JS (acrônimo recursivo para João Sebastião de Oliveira Bueno Calligaris), as quais ele apresentou com o meu iBook. Lógico, não sem que Murphy se apresentasse. Na primeira palestra dele o iBook TRAVOU, me forçando a ir até o palco tentar consertar as coisas e só poder dizer “JS, f*deu” e desligar o notebook. Detalhe: isso não aconteceu em NENHUM dos testes para a palestra, e é a segunda vez na minha vida que vejo esse iBook travar. Murphy comanda. :-/
Foram várias palestras muito interessantes de vários gurus da comunidade, como Luciano Ramalho, Osvaldo Santana, Dorneles Treméa, Gustavo Niemeyer e muitas de pessoas que eu não conhecia e que foram *muito* legais. Uma palestra particularmente inspiradora foi a apresentação sobre Empreendedorismo do Dorneles Treméa (vulgo Déo); ele contou o começo da empresa que ele montou com Xiru (Fabiano Weimar, hoje meu chefe), Sidnei da Silva e outros caras, todas as dificuldades que eles tiveram, os pontos acertados e como ele vive hoje. Muito legal mesmo.
No fim das contas, não hesito em dizer que foi o melhor evento técnico do qual já participei, tanto pelo nível das palestras e palestrantes quanto pelas pessoas que lá estavam. A comunidade Python é melhor :-).
Publicado originalmente em 14/09/2007.
August 10th, 2008 — pt-br, python
Palestra apresentada por mim na III PyConBrasil, em Joinville/SC, no dia 30/08/2007.
Publicado originalmente em 31/08/2007.