Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: [gentoo-dev] [RFC] DIGESTS metadata variable for cache validation
Date: Mon, 02 Feb 2009 20:34:34
Message-Id: 498758E6.5080609@gentoo.org
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Hi,
5
6 I'd like to add a new metadata cache value called DIGESTS which will
7 contain a space separated list of digests which can be
8 used to validate the metadata cache. Like INHERITED and
9 DEFINED_PHASES [1], it will be automatically generated. The first
10 digest in the list will correspond to the ebuild. If there are any
11 inherited eclasses, the digests of those eclasses will follow in a
12 space separated list, in the same order that they occur in the
13 INHERITED variable. The value of the DIGESTS variable will be on
14 line 18 of the metadata cache (just after DEFINED_PHASES).
15
16 For the digest format, I suggest that we use the leftmost 10
17 hexadecimal digits of the SHA-1 digest. The rationale for limiting
18 it to 10 digits (out of 40) is to save space. Due to the avalanche
19 effect [2], 10 digits should be sufficient to ensure that problems
20 resulting from hash collisions are extremely unlikely.
21
22 The primary reason to use a digest for cache validation instead of a
23 timestamp is that it allows the cache validation mechanism to work
24 even if the tree is distributed with a protocol that does not
25 preserve timestamps, such as git or subversion. This would make it
26 possible to distribute metadata cache directly from git and
27 subversion repositories (among others). Since a digest is inherently
28 more expensive to obtain than a timestamp, package managers may use
29 the Manifest entries as a digest cache, in order to avoid the need
30 to compute digests of ebuilds during dependency calculations.
31
32 Does the suggested approach seem reasonable? Would anybody like to
33 suggest any changes?
34
35 [1]
36 http://archives.gentoo.org/gentoo-dev/msg_8c34d8efbc0d31ab28c517403dc83f62.xml
37 [2] http://en.wikipedia.org/wiki/Avalanche_effect
38 - --
39 Thanks,
40 Zac
41
42
43 -----BEGIN PGP SIGNATURE-----
44 Version: GnuPG v2.0.9 (GNU/Linux)
45
46 iEYEARECAAYFAkmHWOQACgkQ/ejvha5XGaOJeQCgouZGO+pbOgJYkzssRVhzMDwt
47 Cq4AoN6NG7SmJ6XjEked1WnZ+CJPXVWj
48 =JSDL
49 -----END PGP SIGNATURE-----

Replies