HDDS-14966. OM UI shows wrong Leader Readiness values#10036
HDDS-14966. OM UI shows wrong Leader Readiness values#10036Russole wants to merge 2 commits intoapache:masterfrom
Conversation
…displaying the correct status in HA
| String nodeId = info.getOmRoleInfo().getNodeId(); | ||
| String role = nodeId.equals(leaderId) ? "LEADER" : "FOLLOWER"; | ||
| String leaderReadiness = nodeId.equals(leaderId) | ||
| ? "LEADER_AND_READY" : "NOT_LEADER"; |
There was a problem hiding this comment.
Correct me if I'm wrong, I remember there are some enum with string literal defintiton already?
There was a problem hiding this comment.
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.
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @Russole for the patch.
| String leaderReadiness = nodeId.equals(leaderId) | ||
| ? "LEADER_AND_READY" : "NOT_LEADER"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I think we should consider reverting HDDS-11726 then. BTW, the problem was also reported in the original PR: #7628 (comment)
There was a problem hiding this comment.
Thanks @adoroszlai , based on the current implementation of OzoneManagerRatisServer, getLeaderStatus() only reflects the local OM's Raft server state (via the local division), and there is no mechanism to retrieve readiness for other OM nodes.
This means the UI currently does not have access to per-node leader readiness in an HA setup.
So while the original issue comes from applying the local status to all rows, the underlying limitation is that per-OM readiness is not available from the current API.
Given that, we may need to either extend the backend to expose per-node readiness, or consider removing the column if that information cannot be accurately represented.
What changes were proposed in this pull request?
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-14966
How was this patch tested?