Skip to content

OCPBUGS-109637: Fix phc2sys / chrony stale metric - #739

Open
vitus133 wants to merge 1 commit into
redhat-cne:release-4.22from
vitus133:4.22-backport-OCPBUGS-109637
Open

OCPBUGS-109637: Fix phc2sys / chrony stale metric#739
vitus133 wants to merge 1 commit into
redhat-cne:release-4.22from
vitus133:4.22-backport-OCPBUGS-109637

Conversation

@vitus133

@vitus133 vitus133 commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

Backport of the fix for OCPBUGS-98227 to release-4.22.

With the ntpfailover plugin, openshift_ptp_clock_state{iface="CLOCK_REALTIME", ...} could report stale values for the process (phc2sys/chronyd) that had just gone inactive, since the old metric was never cleared when switching between phc2sys and chronyd as the active CLOCK_REALTIME source. This meant two CLOCK_REALTIME metrics could exist simultaneously, one of them stale, and the actual state was unrelated to which process was active.

Cherry-picked commit

Cleans up the old CLOCK_REALTIME metric so exactly one exists at all times, corresponding to whichever process (phc2sys or chronyd) is actually active.

Cherry-pick applied cleanly

Jira: https://redhat.atlassian.net/browse/OCPBUGS-109637

Fix phc2sys / chrony stale metric by cleaning up the old metric, so there is only exactly oneCLOCK_REALTIME metric on the system at all times

Assisted by Cursor
@openshift-ci-robot

Copy link
Copy Markdown

@vitus133: This pull request references Jira Issue OCPBUGS-109637, which is invalid:

  • expected dependent Jira Issue OCPBUGS-98227 to be in one of the following states: MODIFIED, ON_QA, VERIFIED, but it is Closed (Done) instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Backport of the fix for OCPBUGS-98227 to release-4.22.

With the ntpfailover plugin, openshift_ptp_clock_state{iface="CLOCK_REALTIME", ...} could report stale values for the process (phc2sys/chronyd) that had just gone inactive, since the old metric was never cleared when switching between phc2sys and chronyd as the active CLOCK_REALTIME source. This meant two CLOCK_REALTIME metrics could exist simultaneously, one of them stale, and the actual state was unrelated to which process was active.

Cherry-picked commit

Cleans up the old CLOCK_REALTIME metric so exactly one exists at all times, corresponding to whichever process (phc2sys or chronyd) is actually active.

Cherry-pick applied cleanly (only trivial auto-merges in go.mod, metrics.go, registry.go).

Verification

  • go vet ./plugins/ptp_operator/... clean
  • go test ./plugins/... passes, including new clear_stale_test.go and updated ntp_test.go
  • go mod tidy produces no diff

Jira: https://redhat.atlassian.net/browse/OCPBUGS-109637

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vitus133

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cc014f2f-70fe-4cd7-aed8-0f645dae9a00

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vitus133

Copy link
Copy Markdown
Member Author

/verified later @klaskosk

@openshift-ci-robot

Copy link
Copy Markdown

@vitus133: This PR has been marked to be verified later by @klaskosk.

Details

In response to this:

/verified later @klaskosk

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@vitus133

Copy link
Copy Markdown
Member Author

/label backport-risk-assessed

@vitus133

Copy link
Copy Markdown
Member Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@vitus133: This pull request references Jira Issue OCPBUGS-109637, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-98227 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-98227 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents

Requesting review from QA contact:
/cc @klaskosk

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: klaskosk.

Note that only redhat-cne members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

@vitus133: This pull request references Jira Issue OCPBUGS-109637, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-98227 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-98227 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents

Requesting review from QA contact:
/cc @klaskosk

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants