Skip to content

HDDS-14966. OM UI shows wrong Leader Readiness values#10036

Open
Russole wants to merge 2 commits intoapache:masterfrom
Russole:HDDS-14966
Open

HDDS-14966. OM UI shows wrong Leader Readiness values#10036
Russole wants to merge 2 commits intoapache:masterfrom
Russole:HDDS-14966

Conversation

@Russole
Copy link
Copy Markdown
Contributor

@Russole Russole commented Apr 3, 2026

What changes were proposed in this pull request?

  • Fix incorrect Leader Readiness display in OM HA UI by computing the value per node instead of using the local OM status.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14966

How was this patch tested?

  • Verified the fix by running a 3-OM HA cluster and checking the OM Web UI. The Leader Readiness column now shows correct per-node values.
  • OM Leader
Om_1
  • OM Follwer 1
Om_2
  • OM Follwer 2
Om_3

Comment on lines +1092 to +1095
String nodeId = info.getOmRoleInfo().getNodeId();
String role = nodeId.equals(leaderId) ? "LEADER" : "FOLLOWER";
String leaderReadiness = nodeId.equals(leaderId)
? "LEADER_AND_READY" : "NOT_LEADER";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, I remember there are some enum with string literal defintiton already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. RaftServerStatus defines these values, but it is in the ozone-manager module and cannot be used here due to module boundaries.
For LEADER and FOLLOWER, I used the existing RaftPeerRole enum instead of string literals.

@peterxcli peterxcli requested a review from jojochuang April 3, 2026 03:05
@Russole Russole requested a review from peterxcli April 3, 2026 06:55
Copy link
Copy Markdown
Member

@peterxcli peterxcli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@adoroszlai adoroszlai changed the title HDDS-14966. SCM Web UI Leader Readiness column does not appear to be displaying the correct status in HA HDDS-14966. OM UI shows wrong Leader Readiness values Apr 3, 2026
Copy link
Copy Markdown
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Russole for the patch.

Comment on lines +1097 to +1098
String leaderReadiness = nodeId.equals(leaderId)
? "LEADER_AND_READY" : "NOT_LEADER";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaderReadiness should reflect readiness, but currently LEADER_AND_NOT_READY cannot appear in the UI in any case. If we can get correct information about the leader's readiness, we should. Otherwise we should remove the column, since it's redundant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @adoroszlai for the review — good catch.
Currently, the UI does not have access to the actual leader readiness for each OM, so the value is derived from the node’s role. As a result, LEADER_AND_NOT_READY cannot be reflected.

We can either extend this to fetch the real leader readiness from the leader node, or consider removing the column if it is considered redundant.

This change focuses on fixing the inconsistent UI behavior across leader and follower nodes while keeping the existing semantics unchanged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should consider reverting HDDS-11726 then. BTW, the problem was also reported in the original PR: #7628 (comment)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants