-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Mon, Jul 27, 2020 at 10:35:56AM +0000, WillyPillow wrote:
> This is something that I realized when experimenting with the `--refresh` flag
> for force updating repo metadata: in essence, currently the metadata is
> *always* refreshed as DNF detects that the mtime of the repo configuration has
> changed.
> 
> This means that, while the correctness is fine, there may potentially be a
> performance issue. Currently, the repositories are quite small in size, so
> practically speaking the impact shouldn't be that large (which is also why I
> did not realize the issue until recently), but I thought I'd still bring it up
> nonetheless.
> 
> A low hanging fruit to somewhat reduce the impact is to allow multiple spec
> strings in `qubes.TemplateSearch`, reducing the number of calls. (Currently,
> we're invoking the qrexec call for every package spec the user passes in.)

This indeed may be the simplest way, but I consider one spec - one call
a cleaner solution.

> To actually utilize the DNF cache, it seems that the following has to be done:
> 
> 1. Check if the repo configuration has been changed (and the last update time
>    and `metadata_expire`) from the qvm-template side.
> 2. Invoke DNF with `--cacheonly` if we deem that the cache can be used.
> 3. Notably, DNF needs to be invoked with `sudo` as `--cacheonly` only uses the
>    system cache and not user-specific ones.
> 
> Alternatively, a hackish way is to cache the hash and mtime of the repo config
> on the updateVM side and override the mtime if the hash matches.

Since the cache is stored in the UpdateVM, IMO storing repo config hash
there sounds like the right thing to do (you can store mtime in the
mtime of the repo config hash file). Then, if unchanged repo config ->
unchanged repo config mtime, then dnf should do the right thing on its
own (respect metadata_expire etc).

I wonder what dnf will say about different repo config path (because of
mktemp), have you checked?

> Again, this is probably not very high-priority; just pointing out that the
> issue exists.

Yes, I agree.

- -- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAl8esPwACgkQ24/THMrX
1yzImAgAmN8UKqd8cNHhaoDVoNHS2ghjnAPLRwhZ//pYKoRtKTPJk3Q80Jt0CRzy
59QKeDWezybveq6zCecp+i1XmNoTZy9ATRZoX1j/DOyY/ni5FIPSI+RmpW4wcpdb
k+tda3EDn2f25vQvyZL4hgYjy2jvvbOr3CxoHQY3ucyJwZGPrNpXXtyOx06B8Xrs
VsJ/L5TS5cGXbM7iNuGMvogxGf8pisaXqdo4NiaxXJoS8O7C347Pb9YuJxtOAgur
JPr/4C77NKzM6bebezrTDHAz2XLsTfDeqTsISgso5OCsjSy/wAALHpXK1yCkDcrB
dH5flShL8BZPDCzilEXDdFNazyRs3Q==
=SuID
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-devel/20200727104828.GN1626%40mail-itl.

Reply via email to