You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Jackson Yao (Jira)" <ji...@apache.org> on 2021/03/25 14:40:00 UTC

[jira] [Issue Comment Deleted] (HDDS-5013) Expect to see OmUuid in SCM audit log, but om1 is shown.

     [ https://issues.apache.org/jira/browse/HDDS-5013?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jackson Yao updated HDDS-5013:
------------------------------
    Comment: was deleted

(was: I have found the reason,it is in OMHANodeDetails.java
{code:java}
if (nodeId == null) {
  // If no nodeId is provided, set the default nodeID - om1
  nodeId = OzoneConsts.OM_DEFAULT_NODE_ID;
  LOG.info("OM Node ID is not set. Setting it to the default ID: {}",
      nodeId);
}
{code}
for now , the nodeId  is null and we will always get the defaultID "om1"

i will fix it later)

> Expect to see OmUuid in SCM audit log, but om1 is shown.
> --------------------------------------------------------
>
>                 Key: HDDS-5013
>                 URL: https://issues.apache.org/jira/browse/HDDS-5013
>             Project: Apache Ozone
>          Issue Type: Bug
>            Reporter: Xu Shao Hong
>            Assignee: Jackson Yao
>            Priority: Major
>         Attachments: 企业微信截图_dd512891-02f6-4f7f-a07e-6a3d8156fe8f.png
>
>
> {code:java}
> /**
>  * Asks SCM where a block should be allocated. SCM responds with the
>  * set of datanodes that should be used creating this block.
>  * @param size - size of the block.
>  * @param num - number of blocks.
>  * @param type - replication type of the blocks.
>  * @param factor - replication factor of the blocks.
>  * @param excludeList - exclude list while allocating blocks.
>  * @return allocated block accessing info (key, pipeline).
>  * @throws IOException
>  */
> @Override
> public List<AllocatedBlock> allocateBlock(long size, int num,
>     HddsProtos.ReplicationType type, HddsProtos.ReplicationFactor factor,
>     String owner, ExcludeList excludeList) throws IOException {
> {code}
>  
> {code:java}
> @Override
> public List<AllocatedBlock> allocateBlock(long size, int num,
>     HddsProtos.ReplicationType type, HddsProtos.ReplicationFactor factor,
>     String owner, ExcludeList excludeList) throws IOException {
>   Map<String, String> auditMap = Maps.newHashMap();
>   auditMap.put("size", String.valueOf(size));
>   auditMap.put("num", String.valueOf(num));
>   auditMap.put("type", type.name());
>   auditMap.put("factor", factor.name());
>   auditMap.put("owner", owner);
>   List<AllocatedBlock> blocks = new ArrayList<>(num);
>   boolean auditSuccess = true;
> {code}
> Tracing back the owner argument, it is shown that it should be omId.
> omId is actually the OmUuid, while the audit we get records "om1" instead of UUID.
>  
>  
> 2021-03-22 20:13:01,210 | INFO | SCMAudit | user=ozoneadmin | ip=10.51.87.181 | op=ALLOCATE_BLOCK \{owner=om1, size=268435456, num=1, type=RATIS, factor=THREE} | ret=SUCCESS | 
>  2021-03-22 20:13:01,224 | INFO | SCMAudit | user=ozoneadmin | ip=10.51.87.181 | op=ALLOCATE_BLOCK \{owner=om1, size=268435456, num=1, type=RATIS, factor=THREE} | ret=SUCCESS | 
>  2021-03-22 20:13:01,231 | INFO | SCMAudit | user=ozoneadmin | ip=10.51.87.181 | op=ALLOCATE_BLOCK \{owner=om1, size=268435456, num=1, type=RATIS, factor=THREE} | ret=SUCCESS | 
>  2021-03-22 20:13:01,238 | INFO | SCMAudit | user=ozoneadmin | ip=10.51.87.181 | op=ALLOCATE_BLOCK \{owner=om1, size=268435456, num=1, type=RATIS, factor=THREE} | ret=SUCCESS | 
>  2021-03-22 20:13:01,289 | INFO | SCMAudit | user=ozoneadmin | ip=10.51.87.181 | op=ALLOCATE_BLOCK \{owner=om1, size=268435456, num=1, type=RATIS, factor=THREE} | ret=SUCCESS |



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org