{"thread":{"id":"19911","subject":"crash proof / recovery from power loss","startedAt":"2009-06-23T21:05:56Z","lastAt":"2009-06-25T13:31:29Z","messageCount":3,"participants":["Sascha Silbe","Jakub Narebski","Martin Langhoff"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"116835","messageId":"20090623210556.GB31015@twin.sascha.silbe.org","threadId":"19911","inReplyTo":null,"subject":"crash proof / recovery from power loss","fromName":"Sascha Silbe","fromEmail":"sascha-ml-devel-vcs-git@silbe.org","sentAt":"2009-06-23T21:05:56Z","receivedAt":"2009-06-23T21:05:56Z","isPatch":false,"sender":{"key":"sascha-ml-devel-vcs-git@silbe.org","avatar":null},"body":"Hi!\n\n\nI'm going to use git as a back end for the Sugar data store / Journal. \n[1]\nOne thing I'm worried about is how it's going to behave if a crash (e.g. \npower loss - no corruption) occurs.\nWhat can happen in such a case? Is it always recoverable and if so, how?\n\n\n[1] http://wiki.sugarlabs.org/go/Version_support_for_datastore\n\nCU Sascha\n\n-- \nhttp://sascha.silbe.org/\nhttp://www.infra-silbe.de/"},{"id":"116929","messageId":"m37hz0xxuq.fsf@localhost.localdomain","threadId":"19911","inReplyTo":"20090623210556.GB31015@twin.sascha.silbe.org","subject":"Re: crash proof / recovery from power loss","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-06-25T13:11:52Z","receivedAt":"2009-06-25T13:11:52Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Sascha Silbe <sascha-ml-devel-vcs-git@silbe.org> writes:\n\n> I'm going to use git as a back end for the Sugar data store /\n> Journal. [1]\n>\n> One thing I'm worried about is how it's going to behave if a crash\n> (e.g. power loss - no corruption) occurs.\n> What can happen in such a case? Is it always recoverable and if so, how?\n> \n> \n> [1] http://wiki.sugarlabs.org/go/Version_support_for_datastore\n\nIn Git all operations are atomic.  \n\nIn most cases Git uses the following 'trick': it first\ndownloads/saves/creates data, and only then automatically update\ninformation that it is available.  So crash would result in some\nunreachanble objects, which would go away on prune.\n\nIn some cases Git uses locks to ensure atomicity.  I don't know what\nhappens with locks after a crash...\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"116934","messageId":"46a038f90906250631k5e702f66g50a6e60db8bab856@mail.gmail.com","threadId":"19911","inReplyTo":"20090623210556.GB31015@twin.sascha.silbe.org","subject":"Re: crash proof / recovery from power loss","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2009-06-25T13:31:29Z","receivedAt":"2009-06-25T13:31:29Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On Tue, Jun 23, 2009 at 11:05 PM, Sascha Silbe\n<sascha-ml-devel-vcs-git@silbe.org> wrote:\n> I'm going to use git as a back end for the Sugar data store / Journal. [1]\n> One thing I'm worried about is how it's going to behave if a crash (e.g. power loss - no corruption) occurs.\n> What can happen in such a case? Is it always recoverable and if so, how?\n\nGit is outrageously good in keeping things sane. On that front, you\nwon't see any problems.\n\nNow... there is one area where it will hurt lots: storing large binary\nblobs. Git assumes that every file is very small in comparison with\navailable physical memory.\n\n - Sugar utilities already can create files larger than available\nmemory. Think Record.xo, etoys, etc.\n\n - Many sugar target platforms are _very_ memory constrained. XO-1\nbeing the prime example.\n\nLots of what git does would be good in the Journal. But some of the\ncore assumptions are not well matched.\n\nThere are some tunables in git that might help. And maybe you can\nsidestep the harder corners of the problem by having a threshold, and\nhandling large files separately.\n\nhth,\n\n\n\n\nm\n--\nmartin.langhoff@gmail.com\nmartin@laptop.org -- School Server Architect\n- ask interesting questions\n- don't get distracted with shiny stuff  - working code first\n- http://wiki.laptop.org/go/User:Martinlanghoff\n"}]}