starlingx/update: sw-patch query bug: Applied patches go to a Partial-Applied state after applying a new patch

Bug #2063374 reported by Caio Volpato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Caio Volpato

Bug Description

Brief Description
-----------------

Applied patches go to a Partial-Applied state after applying a new patch, until the system reboot

Severity
--------
Minor: this bug only affects how patches are reported, after the system reboot it goes away

Steps to Reproduce
------------------

Copy a new patch, before it's applied sw-patch shows the following for the new patch:

             Patch ID RR Release Patch State
    =========================== == ======= ===========
    PATCH_0001 Y 9.0 Applied
    PATCH_0002 Y 9.0 Applied
    PATCH_0003 Y 9.0 Applied
    PATCH_0004 Y 9.0 Applied
    PATCH_0005 Y 9.0 Available

Then after applying the latest patch, previously applied patches go to partial-applied, as follows:

             Patch ID RR Release Patch State
    =========================== == ======= =============__
    PATCH_0001 Y 9.0 Partial-Apply |
    PATCH_0002 Y 9.0 Partial-Apply | -> this is not expected
    PATCH_0003 Y 9.0 Partial-Apply__|
    PATCH_0004 Y 9.0 Applied
    PATCH_0005 Y 9.0 Partial-Apply

Expected Behavior
------------------

Previously applied shouldn't have their state change because of a new patch, so in our example patches 1,2 and 3 should remain in the Applied state

Actual Behavior
----------------
Applied patches go to a Partial-Applied state after applying a new patch

Reproducibility
---------------
The issue is 100% reproducible with any patch

System Configuration
--------------------
Tested with simplex (one node system)

Branch/Pull Time/Commit
-----------------------

Issue reproduces most recently on https://opendev.org/starlingx/update/commit/7fef84e36e0b0b1b56ec8c57fdd374e665824af8 (Apr 5, 2024, 4:54 PM GMT-3)

Last Pass
---------

This issue did not pass previously

Test Activity
-------------
The bug was found during a system test

Workaround
----------

Workaround not available

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to update (master)

Reviewed: https://review.opendev.org/c/starlingx/update/+/916800
Committed: https://opendev.org/starlingx/update/commit/32d49f15f14ac28b1f62865fff517cfdffbfdc73
Submitter: "Zuul (22348)"
Branch: master

commit 32d49f15f14ac28b1f62865fff517cfdffbfdc73
Author: caio-volpato <email address hidden>
Date: Fri Apr 19 16:58:11 2024 -0300

    Patch state reporting bugfix

    This commit fixes the sw-patch reporting bug.

    Bug description: Applied patches go to a Partial-Applied state
    after applying a new reboot-required patch, until the system reboots.

    Please note that this bug only happens when applying a new patch,
    when removing patches the previously applied patches don't have
    their state changed.

    sw-patch query result before applying a new patch:

                 Patch ID RR Release Patch State
        =========================== == ======= ===========
        PATCH_0001 Y 9.0 Applied
        PATCH_0002 Y 9.0 Applied
        PATCH_0003 Y 9.0 Applied
        PATCH_0004 Y 9.0 Applied
        PATCH_0005 Y 9.0 Available

    Then after applying the latest patch, previously applied patches
    go to partial-applied, as follows:

                 Patch ID RR Release Patch State
        =========================== == ======= =============
        PATCH_0001 Y 9.0 Partial-Apply
        PATCH_0002 Y 9.0 Partial-Apply
        PATCH_0003 Y 9.0 Partial-Apply
        PATCH_0004 Y 9.0 Applied
        PATCH_0005 Y 9.0 Partial-Apply

    This happens because the previously applied patches commit
    doesn't match the latest_sysroot_commit, but the latest applied patch
    (in our example PATCH_0004) do have their commit matching, so we need
    to mark their dependent patches as Applied.

    Test Plan:

    PASS: For in-service patches (non reboot-required) the issues doesn't happen and the bugfix in place it has the same behavior.

    PASS: Python code for patch_controler.py unit tests pass and a
    a new test case was created to cover this condition

    After this bugfix, using a virtual machine with patched code, the patch reports are the following:

                 Patch ID RR Release Patch State
        =========================== == ======= =============
        PATCH_0001 Y 9.0 Applied
        PATCH_0002 Y 9.0 Applied
        PATCH_0003 Y 9.0 Applied
        PATCH_0004 Y 9.0 Applied
        PATCH_0005 Y 9.0 Partial-Apply

    Closes-Bug: 2063374

    Change-Id: Ibceeecbf025535b73886517b6ce02e6013d99aea
    Signed-off-by: caio-volpato <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.10.0 stx.update
Changed in starlingx:
assignee: nobody → Caio Volpato (caio-volpato-wr)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.