Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-06-02 Thread Florian Festi
As the change here is between the libsolv transaction and the creation of the 
rpm transaction checking for changes in the database can't really solve the 
problems if done within rpm only. DNF could check the database after obtaining 
the ts lock, but that's something we allow already - it's just not done.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-637416621___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-06-02 Thread Florian Festi
Yes, there may be more holes. But here all these additional checks won't catch 
anything unless DNF checks the return value of addErase. As RPM just doesn't 
add the transaction element at all there is nothing to check later. One could 
argue that rpm should just destroy the transaction but I'd argue an API use may 
actually want to ignore the error message and be content with the package no 
longer being there.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-637415093___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-06-02 Thread Panu Matilainen
So... rpmtsCheck() should be performed once with the transaction lock held, and 
additionally we should check that conditions haven't otherwise changed in the 
meanwhile. Including but not limited to packages that are to be erased didn't 
go away.

Getting it all done and right is a non-trivial thing, but we could start with a 
large hammer that flags the transaction invalid if *anything* in the rpmdb 
changes between creation and running the set.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-637394018___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-06-02 Thread Panu Matilainen
The behavior depends on *when* that somebody else does stuff behind your back 
though - it can easily happen *after* you added stuff to the transaction, in 
which case you indeed don't receive any errors.

This goes to all sorts of other things too: if you assume lockless operation 
between calculating the transaction and executing it, we'd need to verify 
*everything* inside rpmtsRun() because there could be conflicts installed, 
dependencies gone missing and whatever. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-637388382___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-06-02 Thread Florian Festi
Closed #1214.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#event-3396480725___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-06-02 Thread Florian Festi
Just to add this here, too: ts.addErase returns an error code. False aka 0 is 
the erase element could be added and True aka 1 of it can't. DNF is ignoring 
this. So the transaction element is not disappearing - it is not created in the 
first place. I can't really see where RPM is at fault here. Closing.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-637379312___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-05-13 Thread Panu Matilainen
In the same vein, rpm can also replace previously added elements behind your 
back in some cases (although I doubt dnf actually runs into that situation). 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-627930191___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-05-13 Thread Panu Matilainen
Oh and to clarify this:
> When I created any transaction element in rpm (ts.addErase(tsi.pkg.idx)) I 
> expect that the transaction element will not disappear.

Rpm *will* just ignore that added erasure if that package was already added 
into the set, whether directly or indirectly (via obsoletes or upgrade).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-627928916___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-05-13 Thread Panu Matilainen
There seems to be a rather fundamental misunderstanding  of the API here. 
Adding something into rpm transaction can (and will) create any number of 
additional transaction elements as a side-effect, this has always been the 
case. If you assume 1:1 relation between add*Foo() and what's in the 
transaction, yes there will be problems.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-627920860___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-05-13 Thread Jaroslav Mracek
Please could you look at dnf/db/group.py:_populate_rpm_ts()? There you will see 
that for each element in swdb we created a single rpm transaction element. The 
problem is when transaction elements do not match after transaction.
When I created any transaction element in rpm (ts.addErase(tsi.pkg.idx)) I 
expect that the transaction element will not disappear.

Is it clear now?

I need to know - is transaction disappearing behaviour a bug (I believe that 
this a bug)? If this is a feature I need to know how to detect disappeared 
transaction item and a reason.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-627909695___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] ts.addErase(tsi.pkg.idx) skips already erased items (#1214)

2020-05-12 Thread Panu Matilainen
Sorry but I don't understand this bug report any more than the referenced 
bugzilla item.

Surely you're not suggesting the demonstrated rpm cli behavior is buggy? So 
what exactly is the problem here? Python addErase() on a non-existent header id 
not returning error, or something else? Rpm certainly does ignore duplicate 
erasure requests, eg when a thing is already marked for erasure through an 
upgrade, and then specific erasure is added, this is just ignored aka skipped.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1214#issuecomment-627272287___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint