Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRILL-6254: IllegalArgumentException: the requested size must be non-… #1179

Closed
wants to merge 1 commit into from

Conversation

ppadma
Copy link
Contributor

@ppadma ppadma commented Mar 21, 2018

…negative

We should limit memory allocation to number of records that are going to be in the next batch, not the total number of records remaining. For very large remaining record count, when multiplied with high cardinality, integer overflows and is becoming negative.

@priteshm
Copy link

@BitBlender can you please review this?

Copy link

@karthik-man karthik-man left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any test changes/additions that have to be done to go with this change ?

Copy link
Contributor

@paul-rogers paul-rogers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. +1


// remainingRecordCount can be much higher than number of rows we will have in outgoing batch.
// Do memory allocation only for number of rows we are going to have in the batch.
if (!doAlloc(Math.min(remainingRecordCount, flattenMemoryManager.getOutputRowCount()))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this fix at all... If we run out of memory, we should throw an OutOfMemoryException rather than trying to set flags and handle the case. In particular, after the batch sizing fixes, if we can't allocate memory now, something is very wrong and we'll never be able to. This code may be a vestige of the old system where operators tried to negotiate via OUT_OF_MEMORY statuses...

@asfgit asfgit closed this in 67710bb Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants