Skip to content

OCPBUGS-104541: Separate T-GM state from master state - #747

Open
lack wants to merge 1 commit into
redhat-cne:mainfrom
lack:OCPBUGS-104541
Open

lack wants to merge 1 commit into
redhat-cne:mainfrom
lack:OCPBUGS-104541

Conversation

@lack

@lack lack commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

T-GM status processing used the generic "master" stats entry to track its last state. The ptp4l and ts2phc paths update that same entry and can reach LOCKED before the authoritative T-GM-STATUS line is processed. The subsequent LOCKED-to-LOCKED comparison suppresses the T-GM recovery event, leaving secondary master resources at FREERUN from the consumer's perspective.

Track T-GM alias, dependent state, offset, and last sync state under the existing GMMainClockName entry instead. This mirrors the T-BC state isolation and prevents faster generic master updates from consuming the T-GM transition. The physical interface entry remains the source of the DPLL phase offset.

Update the existing parser test to inspect the dedicated GM state and add a regression test in which generic master reaches LOCKED before T-GM recovers. Verify that the T-GM LOCKED state is retained and a PtpStateChange event is still published.

Assisted-by: GPT-5.6 Sol and pi.dev

T-GM status processing used the generic "master" stats entry to track its
last state. The ptp4l and ts2phc paths update that same entry and can reach
LOCKED before the authoritative T-GM-STATUS line is processed. The subsequent
LOCKED-to-LOCKED comparison suppresses the T-GM recovery event, leaving
secondary master resources at FREERUN from the consumer's perspective.

Track T-GM alias, dependent state, offset, and last sync state under the
existing GMMainClockName entry instead. This mirrors the T-BC state isolation
and prevents faster generic master updates from consuming the T-GM transition.
The physical interface entry remains the source of the DPLL phase offset.

Update the existing parser test to inspect the dedicated GM state and add a
regression test in which generic master reaches LOCKED before T-GM recovers.
Verify that the T-GM LOCKED state is retained and a PtpStateChange event is
still published.

Assisted-by: GPT-5.6 Sol and pi.dev
@openshift-ci-robot

Copy link
Copy Markdown

@lack: This pull request references Jira Issue OCPBUGS-104541, which is invalid:

  • expected the bug to target either version "5.1.0." or "openshift-5.1.0.", but it targets "5.0.0" 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:

T-GM status processing used the generic "master" stats entry to track its last state. The ptp4l and ts2phc paths update that same entry and can reach LOCKED before the authoritative T-GM-STATUS line is processed. The subsequent LOCKED-to-LOCKED comparison suppresses the T-GM recovery event, leaving secondary master resources at FREERUN from the consumer's perspective.

Track T-GM alias, dependent state, offset, and last sync state under the existing GMMainClockName entry instead. This mirrors the T-BC state isolation and prevents faster generic master updates from consuming the T-GM transition. The physical interface entry remains the source of the DPLL phase offset.

Update the existing parser test to inspect the dedicated GM state and add a regression test in which generic master reaches LOCKED before T-GM recovers. Verify that the T-GM LOCKED state is retained and a PtpStateChange event is still published.

Assisted-by: GPT-5.6 Sol and pi.dev

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 Sep 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lack
Once this PR has been reviewed and has the lgtm label, please assign jzding for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 Sep 14, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1dfbb639-b5f2-4738-9356-c487e35cc339

📥 Commits

Reviewing files that changed from the base of the PR and between b020da1 and 3e4a854.

📒 Files selected for processing (2)
  • plugins/ptp_operator/metrics/logparser.go
  • plugins/ptp_operator/metrics/logparser_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved T-GM synchronization status tracking by keeping its state separate from the generic master clock state.
    • Fixed recovery event reporting when the generic master source is already locked.
    • Updated status validation to consistently use the dedicated T-GM clock state.

Walkthrough

The T-GM parser now stores and evaluates aggregate state under the dedicated GM main clock entry. Tests verify that generic master state does not suppress T-GM recovery events.

Changes

T-GM state tracking

Layer / File(s) Summary
Route T-GM state to the GM main clock
plugins/ptp_operator/metrics/logparser.go
T-GM source checks, aliases, dependent state, offsets, sync state, and metrics updates now use stats.GMMainClockName instead of the generic master clock.
Validate independent T-GM transitions
plugins/ptp_operator/metrics/logparser_test.go
Tests read T-GM state from the dedicated entry and verify that a locked generic master does not suppress a T-GM recovery event.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: vitus133

Merge Risk: ⚪ Minimal · up to 3e4a8

The dedicated GM state tracking and regression coverage do not show an outstanding merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states that T-GM state is separated from generic master state. It is concise and directly matches the main change.
Description check ✅ Passed The description accurately explains the state-tracking issue, the parser changes, and the regression test. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@lack

lack commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

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

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.1.0) matches configured target version for branch (5.1.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (bblock@redhat.com), skipping review request.

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.

@lack

lack commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@lack: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 3e4a854 link true /test images

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

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