[Sugar-devel] Datastore API changes

Tomeu Vizoso tomeu at sugarlabs.org
Sat Jul 4 09:53:32 EDT 2009


On Sat, Jul 4, 2009 at 13:15, Sascha
Silbe<sascha-ml-ui-sugar-devel at silbe.org> wrote:
> On Thu, Jul 02, 2009 at 04:14:36PM +0200, Tomeu Vizoso wrote:
>
>> Also copying a file can be quite expensive, specially on the XO-1.
>
> That's the reason for these requirement:
>
>   * data should be provided on the same FS as the Journal (for hardlinking)
>   * activities must not modify the entry they submit to data store before it
> has been commited (and the activity notified about that)
>       * Python API may copy file if activity indicates it doesn't fulfill
> this requirement
>   * activities must not modify the entry they received from datastore
>       * Python API may copy file if activity indicates it doesn't fulfill
> this requirement
>   * VCS backend must not modify files that have been provided as input (for
> commit) or checked out => link-breaking
>       * if the VCS doesn't support this, the backend needs to implement it
> by copying

Sounds good, it's pretty similar to what we have now other than
transfer_ownership goes to the DS which then copies the file if it is
false. I'm not sure there's much benefit to have the python API do the
copy because the gio API already makes quite easy async I/O, so
activities that cannot transfer ownership of the file could copy it
before passing it to the DS and report the progress to the user
themselves.

I'm happy we are reviewing the API with Bert because he has giving
this some thought already and because the current API was hacked to
support these optimizations along the way.

> I'm going to make extensive use of hardlinking. While a two-edged sword (if
> the activity retains a directory entry to the file it can potentially change
> the in-datastore "copy") it can also greatly reduce the amount of copying to
> be done.

Another risk could be leaking inodes if we get a too complex hard-link
structure.

Regards,

Tomeu

> CU Sascha
>
> --
> http://sascha.silbe.org/
> http://www.infra-silbe.de/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iQEcBAEBAgAGBQJKTznBAAoJELpz82VMF3DakpcH/Asi25tyQ9CwMIoaOUKyO3Wi
> dvWoUEXPQPbG6zYDPgAxXNEJ3vtPdEy5YVZhtzSsjHyBka2Cw8jRnpP1LWfoQr8E
> 1k7lqr3QEmcMIGF6PAbPLukCc1ftG8VIJzWkH/P0A0D+qmd1MsGSeOEBHrvV7gSf
> Q7KbWvA/qsc8HsE2T9Yt3vyZRlAPj8IiiHv/UUlg4adOe9WAke8eDtOaIUX6CbpZ
> BBnK6Z0WXqX+L5pHKSn8hoH82pP5bEpLS5OO0+jRG0cS33E/ji5Cnphs7ENVXJzd
> +dV1HeGrWQ8UQZYgPTpIrWJ+O2gPAwoFRE6H+X/0i9aoCZSywnx5O5qOsZIaxWw=
> =6PRj
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>


More information about the Sugar-devel mailing list