Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21342

FileSystem in use may get closed by other bulk load call in secure bulkLoad

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-1, 2.1.0, 1.5.0, 1.3.3, 1.4.4, 2.0.1, 1.2.7
    • 3.0.0-alpha-1, 2.2.0, 2.1.1, 2.0.3
    • None
    • None

    Description

      As mentioned in HBASE-15291, there is a race condition.   If Two secure bulkload calls  from the same UGI into two different regions and one region finishes earlier, it will close the bulk load fs, and the other region will fail.

       

      Another case would be more serious. The FileSystem.close() function needs two synchronized variables : CACHE and deleteOnExit. If one region calls FileSystem.closeAllForUGI ( in SecureBulkLoadManager.cleanupBulkLoad) while another region is trying to close srcFS ( in  SecureBulkLoadListener.closeSrcFs)   , can cause deadlock here.

       

      I have wrote a UT for this and fixed it using reference counter.

       

      Attachments

        1. race.patch
          12 kB
          mazhenlin
        2. 21342.v1.txt
          12 kB
          Ted Yu
        3. HBASE-21342.002.patch
          12 kB
          mazhenlin
        4. HBASE-21342.003.patch
          13 kB
          mazhenlin
        5. HBASE-21342.004.patch
          14 kB
          mazhenlin
        6. HBASE-21342.005.patch
          14 kB
          mazhenlin
        7. HBASE-21342.006.patch
          15 kB
          mazhenlin
        8. HBASE-21342.007.patch
          16 kB
          mazhenlin

        Issue Links

          Activity

            People

              mazhenlin mazhenlin
              mazhenlin mazhenlin
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: