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

Audit log all EC policy names during addErasureCodingPolicies

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.2.0, 3.1.2
    • erasure-coding
    • None
    • Reviewed

    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

        1. HDFS-13217.005.patch
          2 kB
          liaoyuxiangqin
        2. HDFS-13217.004.patch
          2 kB
          liaoyuxiangqin
        3. HDFS-13217.003.patch
          2 kB
          liaoyuxiangqin
        4. HDFS-13217.002.patch
          2 kB
          liaoyuxiangqin
        5. HDFS-13217.001.patch
          2 kB
          liaoyuxiangqin

        Issue Links

          Activity

            People

              liaoyuxiangqin liaoyuxiangqin
              liaoyuxiangqin liaoyuxiangqin
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: