The precedence of arguments is not obvious.
- If both uname and xml_id are specified, we look up a remote node by uname only (both should be the same of course). Otherwise, if xml_id is specified, we use that.
- If both id and xml_id are specified, we look up a cluster node by (cluster-layer) ID only. Otherwise, if xml_id is specified, we use that (and check whether the by-id result matches the by-name result).
- If xml_id is specified, we look up a CIB-cached node by the XML ID only. Otherwise, if id is specified, we use a stringified version of id.
See https://github.com/ClusterLabs/pacemaker/pull/3796#discussion_r1914293732.
As Ken mentioned, documenting this current behavior might make it more confusing. However, it might be possible to at least make the precedence consistent. We'd have to ensure no existing callers' behavior is affected.