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

clearCorruptLazyPersistFiles incrementalBlock removal should be out side write lock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.2.1
    • None
    • namenode
    • None

    Description

       In LazyPersistFileScrubber#clearCorruptLazyPersistFiles collecting blocks for removal and also removing them in write lock.

      removeBlocks should be moved out of writelock as removeBlocks has incremental deletion logic in which it will acquire write lock and unlock for every block removal.

      If there are more corrupt blocks to remove in cluster, it may hold write lock for longer time. 

        for (BlockCollection bc : filesToDelete) {
                LOG.warn("Removing lazyPersist file " + bc.getName() + " with no replicas.");
                BlocksMapUpdateInfo toRemoveBlocks =
                    FSDirDeleteOp.deleteInternal(
                        FSNamesystem.this,
                        INodesInPath.fromINode((INodeFile) bc), false);
                changed |= toRemoveBlocks != null;
                if (toRemoveBlocks != null) {
                  removeBlocks(toRemoveBlocks); // Incremental deletion of blocks
                }
              }
      

       

      Attachments

        Activity

          People

            umamaheswararao Uma Maheswara Rao G
            umamaheswararao Uma Maheswara Rao G
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: