Bug 1190548 - [RFE]: Make cache usable to all users
Summary: [RFE]: Make cache usable to all users
Keywords:
Status: CLOSED DUPLICATE of bug 1185741
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1211166 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-09 04:08 UTC by Christopher Meng
Modified: 2015-08-31 12:41 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-03-03 15:25:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1255278 0 unspecified CLOSED [RFE] Make repoquery use "system" metadata 2021-02-22 00:41:40 UTC

Internal Links: 1255278

Description Christopher Meng 2015-02-09 04:08:34 UTC
Hi,

I'd like to know if this is a bad design or not:

                            ========DNF=======

$dnf update clang*
RPM Fusion for Fedora Rawhide - Nonfree                                                                                      2.1 kB/s | 171 kB     01:19    
google-chrome                                                                                                                 11 kB/s | 3.7 kB     00:00    
RPM Fusion for Fedora Rawhide - Free                                                                                         149 kB/s | 479 kB     00:03    
Rawhide kernels built without debugging turned on                                                                            119 kB/s | 504 kB     00:04    
Fedora - Rawhide - Developmental packages for the next Fedora release                                                        204 kB/s |  38 MB     03:11    
Dependencies resolved.
=============================================================================================================================================================
 Package                            Arch                              Version                                     Repository                            Size
=============================================================================================================================================================
Upgrading:
 clang                              i686                              3.5.0-6.fc22                                rawhide                               14 M

Transaction Summary
=============================================================================================================================================================
Upgrade  1 Package

Total download size: 14 M
Is this ok [y/N]: y
Downloading Packages:
clang-3.5.0-6.fc22.i686.rpm                                                                                                  137 kB/s |  14 MB     01:41    
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        132 kB/s |  14 MB     01:46     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Failed to obtain the transaction lock (logged in as: xxxxxx).
                            ========END=======





yum never let normal users do transactions even there are no upgrades/updates or just downloading.

                            ========YUM=======
$ yum update
Loaded plugins: auto-update-debuginfo, fastestmirror
You need to be root to perform this command.
                            ========END=======

I for real don't like the philosophy behind since I'm under a limited bandwidth mobile network sometimes, rawhide metadata refresh will cost me ~50MB, if I do update everyday, it's not a small size anymore.

But that's not the worst, I just entered dnf update without checking the user I was under, then I found a normal user was used, now I've switched to root but it will download the same file again, it's annoying, this is the key point of this bug.

Is there a way to reuse those cache?(I've enabled keepcache=true in dnf.conf) Since normal user's content is worthless, I hope dnf will have the same behavior like yum(notify users are normal or reuse cache downloaded if keepcache is true)

Comment 1 Honza Silhan 2015-03-03 15:25:28 UTC
Sharing cache is not easy task. We know about it and we plan to extend it to sharing the cache between PackageKit/yum/dnf.

tip: install dnf-plugins-core (noroot plugin) to avoid fetching metadata for root operation - it will abort at the start.

*** This bug has been marked as a duplicate of bug 1185741 ***

Comment 2 Radek Holy 2015-04-13 09:56:31 UTC
*** Bug 1211166 has been marked as a duplicate of this bug. ***

Comment 3 Elad Alfassa 2015-04-13 10:30:17 UTC
(In reply to Jan Silhan from comment #1)
> Sharing cache is not easy task. We know about it and we plan to extend it to
> sharing the cache between PackageKit/yum/dnf.

Sharing metadata between users seems relatively simple to me (sharing with PK is another story): check if global (owned by root) metadata exists. If it exists, use it. If not, go to the slow path of downloading the metadata for the user only.
You could also add a lock file so that if root is refreshing the metadata to prevent race conditions.

What am I missing? is there some complexity here I didn't think about?

> 
> tip: install dnf-plugins-core (noroot plugin) to avoid fetching metadata for
> root operation - it will abort at the start.
> 

This is not helpful when you want to do non privileged operations such as search.

Comment 4 Radek Holy 2015-04-13 10:42:55 UTC
(In reply to Elad Alfassa from comment #3)
> (In reply to Jan Silhan from comment #1)
> > Sharing cache is not easy task. We know about it and we plan to extend it to
> > sharing the cache between PackageKit/yum/dnf.
> 
> Sharing metadata between users seems relatively simple to me (sharing with
> PK is another story): check if global (owned by root) metadata exists. If it
> exists, use it. If not, go to the slow path of downloading the metadata for
> the user only.
> You could also add a lock file so that if root is refreshing the metadata to
> prevent race conditions.
> 
> What am I missing? is there some complexity here I didn't think about?

I agree with you (that's the reason why I've marked you bug as a duplicate of this bug and of the bug referenced here). On the other hand, AFAIK there is already a plan to implement the cache sharing service and if it's true, it's probably better for DNF (and consequently for its users) to wait for it and not complicate its code base just for the meantime.

> > 
> > tip: install dnf-plugins-core (noroot plugin) to avoid fetching metadata for
> > root operation - it will abort at the start.
> > 
> 
> This is not helpful when you want to do non privileged operations such as
> search.

This should be helpful for the original reporter because he run "dnf upgrade", the command downloaded the metadata and only then he got the message that the command cannot continue without the needed privileges. With the plugin, the command would fail immediately and thus it wouldn't download the unneeded amount of data.

The tip is not a solution nor a workaround for this problem. It could have just save the bandwidth in the given situation.

Comment 5 Honza Silhan 2015-08-31 12:41:48 UTC
*** Bug 1255278 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.