<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    I'll try to reproduce the issue as it looks like a bug in our code,
    especially if someone else could confirm that after upgrade to 2.6
    this can be seen consistently on any machine.<br>
    The changes in commit 95345b58a86b134084bcc5a8c07ae452f1574670 are
    not causing this as the change is about requesting repodata
    regeneration only once instead of twice.<br>
    <br>
    Tomas<br>
    <br>
    <div class="moz-cite-prefix">On 09/11/2017 03:40 PM, Florian
      Gleixner wrote:<br>
    </div>
    <blockquote cite="mid:f69d687d-954a-81ac-4880-36146b777b8e@lrz.de"
      type="cite">Am 30.08.2017 um 15:33 schrieb Lichtinger, Bernhard:
      <br>
      <blockquote type="cite">Hello,
        <br>
        <br>
        I see a strange behavior of spacewalk using
        spacewalk-manage-channel-lifecycle:
        <br>
        Everytime I promote a channel all erratas which source and
        destination channel have in common are removed from the source
        channel.
        <br>
        <br>
        For example: source channel has 4 (newer) errata more than the
        destination channel. Then after running
        "spacewalk-manage-channel-lifecycle -c source_channel --promote"
        my destination channel has all old errata plus the 4 new ones,
        but my source channel has only the 4 new errata left.
        <br>
        <br>
        The rpm packages in each channel are still linked to the errata,
        but the source channel looses all "old" erratas.
        <br>
        <br>
        It happens with all my channels, RHEL-6,7 and SLES-11,12.
        <br>
        <br>
        I have spacewalk-2.6 on centos-7. I can also reproduce the
        behavior on my test machine with spacewalk-2.6 on centos-6:
        <br>
        I have 2 phases for spacewalk-manage-channel-lifecycle defined:
        test and prod.
        <br>
        So I have 3 baselines of channels: daily (is synced daily with
        upstream repos), test and prod.
        <br>
        <br>
        For a fresh start I clear all erratas from the database:
        <br>
        rhnschema=# truncate rhnErrata CASCADE;;
        <br>
        <br>
        After a full sync of daily with upstream repo, errata count for
        my channels:
        <br>
        daily:    590
        <br>
        test:    0
        <br>
        prod:    0
        <br>
        <br>
        After "spacewalk-manage-channel-lifecycle -c daily --promote"
        errata count for my channels:
        <br>
        daily:    590
        <br>
        test:    590
        <br>
        prod:    0
        <br>
        <br>
        After "spacewalk-manage-channel-lifecycle -c test --promote"
        errata count for my channels:
        <br>
        daily:    590
        <br>
        test:    590
        <br>
        prod:    590
        <br>
        <br>
        So far everything is ok.
        <br>
        <br>
        Now I after a second "spacewalk-manage-channel-lifecycle -c
        daily --promote" errata count for my channels:
        <br>
        daily:    0
        <br>
        test:    590
        <br>
        prod:    590
        <br>
        <br>
        And after a second "spacewalk-manage-channel-lifecycle -c test
        --promote" errata count for my channels:
        <br>
        daily:    0
        <br>
        test:    0
        <br>
        prod:    590
        <br>
        <br>
        With the next sync of daily with upstream daily gets again all
        erratas:
        <br>
        daily:    590
        <br>
        test:    0
        <br>
        prod:    590
        <br>
        <br>
        And this cycle can go on and on.
        <br>
        <br>
        I am not sure, but I think this started after the upgrade from
        2.5 to 2.6, but I could not find any relevant changes in the
        source code of the channel.software.mergeErrata API call. This
        is all code which was not touched in recent times.
        <br>
        <br>
        So, is this a bug in spacewalk or did I only break my
        installations?
        <br>
        <br>
        <br>
      </blockquote>
      <br>
      Hi,
      <br>
      <br>
      i did some more debugging, and when turning on hibernate logging i
      see a delete command, that seems to be responsible for deleting
      erratas in this case:
      <br>
      <br>
      [2017-09-05 17:44:44,128] DEBUG - Pre-invalidating space
      [rhnChannelErrata]
      <br>
      [2017-09-05 17:44:44,128] DEBUG - Deleting collection:
      [com.redhat.rhn.domain.channel.Channel.erratas#212]
      <br>
      [2017-09-05 17:44:44,128] DEBUG - about to open PreparedStatement
      (open PreparedStatements: 0, globally: 0)
      <br>
      [2017-09-05 17:44:44,128] DEBUG - delete from rhnChannelErrata
      where channel_id=?
      <br>
      [2017-09-05 17:44:44,128] DEBUG - delete from rhnChannelErrata
      where channel_id=?
      <br>
      [2017-09-05 17:44:44,130] DEBUG - done deleting collection
      <br>
      <br>
      Digging in spacewalks source i could not find many changes in 2.6
      that can be responsible for that. One candidate is commit
      95345b58a86b134084bcc5a8c07ae452f1574670 from Tomas Lestach, but i
      do not fully understand the code, so probably Tomas or another one
      can have a look at our issue? If you need more logs, we can send
      them.
      <br>
      <br>
      Thanks
      <br>
      <br>
      Florian
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Spacewalk-list mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/spacewalk-list">https://www.redhat.com/mailman/listinfo/spacewalk-list</a></pre>
    </blockquote>
    <br>
  </body>
</html>