Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-4138

RowBatch::AcquireState() cannot be used if the initial capacity of a RowBatch is not known

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Impala 2.7.0
    • Fix Version/s: Impala 2.8.0
    • Component/s: Backend
    • Labels:
      None

      Description

      If you want to acquire the state of a row batch, the usual pattern is something like:

      RowBatch dest(src->row_desc(), batch->capacity(), mem_tracker);
      dest.AcquireState(src);
      

      AcquireState() checks to see if the allocated space for tuple ptrs is the same in both batches - this is calculated by capacity * num_tuples_per_row * sizeof(Tuple*), and is fixed in the constructor.

      But capacity can change after construction, by calling MarkCapacity(). If this happens, dest will allocate too little memory for the tuple ptrs, and AcquireState() will hit a DCHECK.

      The solution seems to be recording the maximum capacity in the c'tor, and using that when constructing dest.

        Attachments

          Activity

            People

            • Assignee:
              henryr Henry Robinson
              Reporter:
              henryr Henry Robinson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: