Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-17411

LLAP IO may incorrectly release a refcount in some rare cases

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0, 3.0.0, 2.4.0
    • Component/s: None
    • Labels:
      None

      Description

      java.io.IOException: java.lang.AssertionError: Unexpected refCount -1: 0x69a390d5(-1)

      In a large stream whose buffers are not reused, and that is separated into many CB (e.g. due to a small ORC compression buffer size), it may happen that some, but not all, buffers that are read together as a unit are evicted from cache.
      If CacheBuffer follows BufferChunk in the buffer list when a stream like this is read, the latter will be converted to ProcCacheChunk; it is possible for early refcount release logic from the former to release the refcount (for a dictionary stream, the initial refCount is always released early), and then backtrack to the latter to see if we can unlock more buffers. It would then to decref an uninitialized MemoryBuffer in ProcCacheChunk because ProcCacheChunk looks like a CacheChunk. PCC initial refcounts are released separately after the data is uncompressed.

      I'm assuming this would almost never happen with non-stripe-level streams because one would need a large RG to span 2+ CBs, no overlap with next/previous RGs in 2+ buffers for the early release to kick in, and an unfortunate eviction order. However it's possible with large-ish dictionaries.

        Attachments

        1. HIVE-17411.patch
          1 kB
          Sergey Shelukhin

          Activity

            People

            • Assignee:
              sershe Sergey Shelukhin
              Reporter:
              sershe Sergey Shelukhin
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: