1 |
On Wed, 2004-12-01 at 01:37, Gregorio Guidi wrote: |
2 |
> On Tue, 30 Nov 2004 06:22:07 -0800, Brian Harring <ferringb@g.o> |
3 |
> |
4 |
> > If you're referencing the nice long pause after sync'ing, that's |
5 |
> > transfer of the cache from ${PORTDIR}/metadata/cache to |
6 |
> > /var/cache/edb/dep/${PORTDIR}; that's been speed up also. Potentially |
7 |
> > might have that pause eliminated also, although that would require |
8 |
> > ensuring the tree is readonly- that's another can of worms. |
9 |
> |
10 |
> I was just thinkng about that, and I could not fully understand this point. |
11 |
> Could you explain a bit more? |
12 |
Expanding on the commentary earlier about a readonly tree/cache vs the |
13 |
current- rsync'd trees are currently treated as modifiable by the user. |
14 |
In other words, the cache for the tree must be verified- this means |
15 |
pulling the mtime from the ebuild, and comparing it to the stored mtime |
16 |
in the cache. Additionally, if the ebuild inherits eclasses, need to |
17 |
check the eclass's mtime and the stored mtime. All of this is done to |
18 |
ensure that if the eclass/ebuild changes, the cache is accurate. |
19 |
|
20 |
So... the rsync'd cache ($portdir/metadata/cache) is accurate to the |
21 |
rsync'd tree, minus user modifications- since the tree is treated as |
22 |
modifiable, the cache *can potentially* be updated. |
23 |
|
24 |
That nice lil long pause is portage transfering the cache from |
25 |
portdir/metadata/cache, into the users local cache |
26 |
(/var/cache/edb/dep/$portdir typically). This is done for a few |
27 |
reasons, |
28 |
|
29 |
1) don't modify $portdir/metadata/cache. Modifying the rsync'd cache |
30 |
directly results in more to rsync for the next sync. Going that route |
31 |
would result in a lot of dial up users out for blood. |
32 |
2) the user may not be using the same cache backend as the distributed |
33 |
cache- the rsync'd cache is portage_db_flat, while the user may be using |
34 |
a custom sqlite backend. I suspect this will be come more common place |
35 |
whenever cvs becomes stabled- the cache backend is being refactored |
36 |
currently. |
37 |
3) cleanse stale entries from the cache, so you don't end up w/ a couple |
38 |
thousand extra files sitting in your local cache. Stable portage |
39 |
accomplishes this by wiping *all* local cache entries, and transferring |
40 |
the *entire* rsync'd cache over. Cvs is smarter, transfers only what |
41 |
has changed, and removes the stale entries (this is why it's faster). |
42 |
|
43 |
So... that's why portage basically copies the cache to a different |
44 |
location. If the tree were treated as readonly, and it was enforced in |
45 |
some manner, that transfer wouldn't be needed. This is something that's |
46 |
being batted around also- the code for making the cache readonly is |
47 |
already done fex. |
48 |
~brian |
49 |
|
50 |
|
51 |
-- |
52 |
gentoo-portage-dev@g.o mailing list |