Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1650

Possible resource leak in upsert select query

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • 4.3.0
    • None
    • None

    Description

      In the upsert select query execution path if parallelIteratorFactory then we are not closing the iterator which results in resource leak.

                          ResultIterator iterator = queryPlan.iterator();
                          if (parallelIteratorFactory == null) {
                              return upsertSelect(statement, tableRef, projector, iterator, columnIndexes, pkSlotIndexes);
                          }
                          parallelIteratorFactory.setRowProjector(projector);
                          parallelIteratorFactory.setColumnIndexes(columnIndexes);
                          parallelIteratorFactory.setPkSlotIndexes(pkSlotIndexes);
                          Tuple tuple;
                          long totalRowCount = 0;
                          while ((tuple=iterator.next()) != null) {// Runs query
                              Cell kv = tuple.getValue(0);
                              totalRowCount += PLong.INSTANCE.getCodec().decodeLong(kv.getValueArray(), kv.getValueOffset(), SortOrder.getDefault());
                          }
                          // Return total number of rows that have been updated. In the case of auto commit being off
                          // the mutations will all be in the mutation state of the current connection.
                          return new MutationState(maxSize, statement.getConnection(), totalRowCount);
      

      Attachments

        1. PHOENIX-1650.patch
          3 kB
          Rajeshbabu Chintaguntla

        Activity

          People

            rajeshbabu Rajeshbabu Chintaguntla
            rajeshbabu Rajeshbabu Chintaguntla
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: