Skip to content

Commit

Permalink
DRILL-6845: Fix handling Retry from put() - for empty partition
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Zvi committed Feb 12, 2019
1 parent 5b4f947 commit 552acdf
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,15 @@ public boolean insertKeyIntoHashTable(VectorContainer buildContainer, int ind, i
try {
status = hashTable.put(ind, htIndex, hashCode, BATCH_SIZE);
} catch (RetryAfterSpillException RE) {
if ( tmpBatchesList.size() == 0 && // extreme case of an empty partition trying to spill
currentVectorContainer.hasRecordCount() && currentVectorContainer.getRecordCount() == 0 ) {
String msg = "Too little memory; try to reduce number of partitions (currently " + numPartitions + ")";
throw new OutOfMemoryException(msg);
}
logger.trace("Semi join ran out of memory while put into hash-table; going to spill {} batches and retry",
tmpBatchesList.size());
spillThisPartition(); // free some memory
tmpBatchesList.size() + 1); // plus the current batch
// Add the current batch to the list, spill and initialize
completeAnInnerBatch(true,true);
return false;
}

Expand Down

0 comments on commit 552acdf

Please sign in to comment.