Bug 1493143
| Summary: | channel.software.mergeErrata deletes errata from source channel if it exists in destination channel | ||
|---|---|---|---|
| Product: | Red Hat Satellite 5 | Reporter: | Tomáš Kašpárek <tkasparek> |
| Component: | API | Assignee: | Tomáš Kašpárek <tkasparek> |
| Status: | CLOSED ERRATA | QA Contact: | Radovan Drazny <rdrazny> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 580 | CC: | bernhard.lichtinger, dyordano, molasaga, rdrazny, saime, tkasparek, tlestach, xdmoon |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | spacewalk-java-2.5.14-102-sat | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2017-12-13 07:59:26 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1450111 | ||
|
Description
Tomáš Kašpárek
2017-09-19 13:19:54 UTC
I had a look into the code and I have a wild guess (I am not familiar with java and hibernate) that the bug might be triggered here: https://github.com/spacewalkproject/spacewalk/blob/master/java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java#L2191 private Set<Errata> mergeErrataToChannel(User user, Set<Errata> errataToMerge, Channel toChannel, Channel fromChannel) { // find errata that we do not need to merge List<Errata> same = ErrataManager.listSamePublishedInChannels( user, fromChannel, toChannel); List<Errata> brothers = ErrataManager.listPublishedBrothersInChannels( user, fromChannel, toChannel); List<Errata> clones = ErrataManager.listPublishedClonesInChannels( user, fromChannel, toChannel); // and remove them errataToMerge.removeAll(same); errataToMerge.removeAll(brothers); errataToMerge.removeAll(clones); ErrataManager.publishErrataToChannelAsync(toChannel, getErrataIds(errataToMerge), user); // no need to regenerate errata cache, because we didn't touch any packages return errataToMerge; } Perhaps the "errataToMerge.removeAll" somehow also deletes the errata from the fromChannel because this are lists of hibernate objects and not only lists of errata ids??? I've tested the PR and I can confirm that it works: spacewalk.git(master): d60097a2cab0ce8fdc441124b145860e7406143a Could you please also fix it for spacewalk-2.7? (In reply to bernhard.lichtinger from comment #5) > Could you please also fix it for spacewalk-2.7? Yes the fix will be in Spacewalk 2.7. Reproduced on spacewalk-java-2.5.14-101.el6sat, verified on spacewalk-java-2.5.14-105.el6sat. I have tested both scenarios - the initial report in comment 0, and spacewalk-manage-channel-lifecycle use described in https://www.redhat.com/archives/spacewalk-list/2017-August/msg00089.html. Both scenarios passed - at the end of the merge, new errata was correctly merged into a cloned channel, and no errata was deleted from the source channel. VERIFIED Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:3445 |