Bug 2108292 - ClusterVersion history pruner does not always retain initial completed update entry
Summary: ClusterVersion history pruner does not always retain initial completed update...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Cluster Version Operator
Version: 4.11
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.z
Assignee: Jack Ottofaro
QA Contact: Evgeni Vakhonin
URL:
Whiteboard:
Depends On: 2097067
Blocks: 2108619
TreeView+ depends on / blocked
 
Reported: 2022-07-18 19:17 UTC by OpenShift BugZilla Robot
Modified: 2022-07-25 07:07 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-25 07:07:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-version-operator pull 798 0 None open [release-4.10] Bug 2108292: pkg/cvo: retain initial completed update history entry 2022-07-18 19:17:38 UTC
Red Hat Product Errata RHSA-2022:5664 0 None None None 2022-07-25 07:07:13 UTC

Comment 1 Evgeni Vakhonin 2022-07-19 13:05:31 UTC
reproducing on 4.10.12 to 4.10.17 using the same method as in https://bugzilla.redhat.com/show_bug.cgi?id=2097067#c4

1. sent upgrade command to 4.10.17
2. upgrade just started - sent rollback command
let first rollback to complete, then looped 1,2 until history is 50

last history item [-1]:
{
  "completionTime": "2022-07-19T12:25:24Z",
  "image": "quay.io/openshift-release-dev/ocp-release@sha256:f77f4f75c1e1a4ddd0a0355f298a834db3473fd9ca473235013e9419d1df16db",
  "startedTime": "2022-07-19T12:00:48Z",
  "state": "Completed",   <--should preserve after pruner
  "verified": false,
  "version": "4.10.12"
}

last history item [-1]:
{
  "completionTime": "2022-07-19T12:34:03Z",
  "image": "quay.io/openshift-release-dev/ocp-release@sha256:87d800b3f7c657ed6f18c920f7c925df91b000805366bee068de3625807abd33",
  "startedTime": "2022-07-19T12:33:44Z",
  "state": "Partial",    <--not preserved!!
  "verified": true,
  "version": "4.10.17"
}

so reproduced successfully on 4.10.. 

now lets verify...

Comment 3 Evgeni Vakhonin 2022-07-19 15:49:51 UTC
pre-merge verifying on 4.10.0-0.ci.test-2022-07-19-105113-ci-ln-5n5dggk-latest to 4.10.0-0.ci.test-2022-07-19-122259-ci-ln-y45rpz2-latest

captured 3 last history entries for better visibility
history length at 50, before prune:
$ oc get clusterversion version -o json | jq '.status.history|length'
50
$ oc get clusterversion version -o json | jq '.status.history[-3:]'
[
  {
    "completionTime": "2022-07-19T15:20:15Z",
    "image": "registry.build05.ci.openshift.org/ci-ln-5n5dggk/release@sha256:f47b974f718ccde37811bd6c707dca1d35020cb335d
bbbf9d5fadfbee50db0a4",
    "startedTime": "2022-07-19T15:19:25Z",
    "state": "Completed",
    "verified": false,
    "version": "4.10.0-0.ci.test-2022-07-19-105113-ci-ln-5n5dggk-latest"
  },
  {
    "completionTime": "2022-07-19T15:19:25Z",
    "image": "registry.build05.ci.openshift.org/ci-ln-y45rpz2/release@sha256:acf73341106ff5c2f7ac0845b1eda1855c1cabb60f6
e033f9dfcdca16b2c8280",
    "startedTime": "2022-07-19T15:19:02Z",
    "state": "Partial",                       <------ this one should be pruned
    "verified": false,
    "version": "4.10.0-0.ci.test-2022-07-19-122259-ci-ln-y45rpz2-latest"
  },
  {
    "completionTime": "2022-07-19T13:10:03Z",
    "image": "registry.build05.ci.openshift.org/ci-ln-5n5dggk/release@sha256:f47b974f718ccde37811bd6c707dca1d35020cb335d
bbbf9d5fadfbee50db0a4",
    "startedTime": "2022-07-19T12:48:49Z",
    "state": "Completed",                    <-------- this one should stay
    "verified": false,
    "version": "4.10.0-0.ci.test-2022-07-19-105113-ci-ln-5n5dggk-latest"
  }
]


history is at maximum length, started one more upgrade to trigger prune..
results after prune:
$ oc get clusterversion version -o json | jq '.status.history|length'
50
$ oc get clusterversion version -o json | jq '.status.history[-3:]'
[
  {
    "completionTime": "2022-07-19T15:20:57Z",
    "image": "registry.build05.ci.openshift.org/ci-ln-y45rpz2/release@sha256:acf73341106ff5c2f7ac0845b1eda1855c1cabb60f6
e033f9dfcdca16b2c8280",
    "startedTime": "2022-07-19T15:20:42Z",
    "state": "Partial",
    "verified": false,
    "version": "4.10.0-0.ci.test-2022-07-19-122259-ci-ln-y45rpz2-latest"
  },
  {
    "completionTime": "2022-07-19T15:20:15Z",
    "image": "registry.build05.ci.openshift.org/ci-ln-5n5dggk/release@sha256:f47b974f718ccde37811bd6c707dca1d35020cb335d
bbbf9d5fadfbee50db0a4",
    "startedTime": "2022-07-19T15:19:25Z",
    "state": "Completed",
    "verified": false,
    "version": "4.10.0-0.ci.test-2022-07-19-105113-ci-ln-5n5dggk-latest"
  },
  {
    "completionTime": "2022-07-19T13:10:03Z",
    "image": "registry.build05.ci.openshift.org/ci-ln-5n5dggk/release@sha256:f47b974f718ccde37811bd6c707dca1d35020cb335d
bbbf9d5fadfbee50db0a4",
    "startedTime": "2022-07-19T12:48:49Z",
    "state": "Completed",
    "verified": false,
    "version": "4.10.0-0.ci.test-2022-07-19-105113-ci-ln-5n5dggk-latest"
  }
]

as we can see, the last "Completed" entry preserved, while the next "Partial" has been pruned, as expected.

Verified.

Comment 6 errata-xmlrpc 2022-07-25 07:07:09 UTC
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 (Important: OpenShift Container Platform 4.10.24 bug fix and security update), 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/RHSA-2022:5664


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