Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13218

Log audit event only used last EC policy name when add multiple policies from file

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.1.0
    • None
    • erasure-coding
    • None

    Description

      When i read the addErasureCodingPolicies() of FSNamesystem class in namenode, i found the following code only used last ec policy name for  logAuditEvent, i think this audit log can't track whole policies for the add multiple erasure coding policies to the ErasureCodingPolicyManager. Thanks.

      FSNamesystem.java
      try {
            checkOperation(OperationCategory.WRITE);
            checkNameNodeSafeMode("Cannot add erasure coding policy");
            for (ErasureCodingPolicy policy : policies) {
              try {
                ErasureCodingPolicy newPolicy =
                    FSDirErasureCodingOp.addErasureCodingPolicy(this, policy,
                        logRetryCache);
                addECPolicyName = newPolicy.getName();
                responses.add(new AddErasureCodingPolicyResponse(newPolicy));
              } catch (HadoopIllegalArgumentException e) {
                responses.add(new AddErasureCodingPolicyResponse(policy, e));
              }
            }
            success = true;
            return responses.toArray(new AddErasureCodingPolicyResponse[0]);
          } finally {
            writeUnlock(operationName);
            if (success) {
              getEditLog().logSync();
            }
            logAuditEvent(success, operationName,addECPolicyName, null, null);
          }
      
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              liaoyuxiangqin liaoyuxiangqin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: