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

Using RefCnt to fix the flawed MemStoreLABImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha-2, 2.4.9
    • 2.5.0, 3.0.0-alpha-3
    • regionserver
    • None
    • Reviewed

    Description

      As HBASE-26465 said, reference count implementation in MemStoreLABImpl is flawed because its checking and increasing or decreasing is not done in atomicity and it ignores state checking when there is illegal state in reference count(eg. increasing or decreasing when the resource is already freed) , just as following incScannerCount and decScannerCount methods illustrated, and this flawed implementation has shield the bugs HBASE-26465 and HBASE-26488.

        public void incScannerCount() {
          this.openScannerCount.incrementAndGet();
        }
      
        public void decScannerCount() {
          int count = this.openScannerCount.decrementAndGet();
          if (this.closed.get() && count == 0) {
            recycleChunks();
          }
        }
      

      We could Introduce RefCnt into MemStoreLABImpl to replace its flawed reference count implementation, so checking and increasing or decreasing is done in atomicity and if there is illegal state in reference count, it would throw exception rather than continue using the corrupt data to cause some subtle bugs, and meanwhile, the code is more simpler.

      Attachments

        Issue Links

          Activity

            People

              comnetwork chenglei
              comnetwork chenglei
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: