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

If kms-acls is failed to load, and it will never be reload

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Scenario : through one automation tool , we are generating kms-acls , though the generation of kms-acls is not completed , the system will detect a modification of kms-alcs and it will try to load

      Before getting the configuration we are modifiying last reload time , code shown below

      private Configuration loadACLsFromFile() {
      LOG.debug("Loading ACLs file");
      lastReload = System.currentTimeMillis();
      Configuration conf = KMSConfiguration.getACLsConf();
      // triggering the resource loading.
      conf.get(Type.CREATE.getAclConfigKey());
      return conf;
      }

      if the kms-acls file written within next 100ms , the changes will not be loaded as this condition "newer = f.lastModified() - time > 100" never meets because we have modified last reload time before getting the configuration

      public static boolean isACLsFileNewer(long time) {
      boolean newer = false;
      String confDir = System.getProperty(KMS_CONFIG_DIR);
      if (confDir != null) {
      Path confPath = new Path(confDir);
      if (!confPath.isUriPathAbsolute()) {
      throw new RuntimeException("System property '" + KMS_CONFIG_DIR +
      "' must be an absolute path: " + confDir);
      }
      File f = new File(confDir, KMS_ACLS_XML);
      LOG.trace("Checking file {}, modification time is {}, last reload time is"
      + " {}", f.getPath(), f.lastModified(), time);
      // at least 100ms newer than time, we do this to ensure the file
      // has been properly closed/flushed
      newer = f.lastModified() - time > 100;
      }
      return newer;
      } 

       

      Attachments

        1. HDFS-14567.patch
          4 kB
          Hemanth Boyina
        2. HDFS-14567.001.patch
          5 kB
          Hemanth Boyina
        3. HDFS-14567.002.patch
          6 kB
          Hemanth Boyina

        Activity

          People

            hemanthboyina Hemanth Boyina
            hemanthboyina Hemanth Boyina
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: