Skip to content

Comments

DRILL-3811: AtomicRemainder incorrectly accounts for transferred allo…#163

Closed
adeneche wants to merge 2 commits intoapache:masterfrom
adeneche:fix-acountor
Closed

DRILL-3811: AtomicRemainder incorrectly accounts for transferred allo…#163
adeneche wants to merge 2 commits intoapache:masterfrom
adeneche:fix-acountor

Conversation

@adeneche
Copy link
Contributor

…cations

Copy link
Contributor

Choose a reason for hiding this comment

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

I was surprised this compiled; in one of my recent patches, I had removed the "public" from TopLevelAllocator, but it seems to have come back. It was removed to force people to use RootAllocatorFactory.newRoot() instead of using the TopLevelAllocator constructor directly. Can you please remove the public from TopLevelAllocator again, and replace this constructor here and on the next line with RootAllocatorFactory.newRoot()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

@cwestin
Copy link
Contributor

cwestin commented Sep 21, 2015

Just one comment, otherwise +1 (non-binding).

@adeneche
Copy link
Contributor Author

TopLevelAllocator's constructor is not public but because the unit test is in the same package it was able to access the constructor anyway. Fixed the test to use RootAllocatorFactory instead

Choose a reason for hiding this comment

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

Since this will be subtracting size bytes, should there be a check for availableShared >=0 ? I am not quite sure what's supposed to happen if this value drops below 0 at this point...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can become negative if the allocator takes ownership of a buffer and exceeds it's maximum allocated memory. Negative values are handled properly, at least that's my understanding

Choose a reason for hiding this comment

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

It is likely handled..I will defer to Chris on that.

Copy link
Contributor

Choose a reason for hiding this comment

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

This call is used when transferring ownership from the RPC layer to a receiving fragment -- and you can't refuse it -- the RPC layer has to hand it off. The problem is that the accounting for buffer ownership transfer and sharing is questionable in the original allocator. This is probably the best that can be done for now.

@amansinha100
Copy link

+1 .

@asfgit asfgit closed this in 942d352 Sep 22, 2015
vkorukanti pushed a commit to vkorukanti/drill that referenced this pull request Sep 27, 2015
vkorukanti pushed a commit to vkorukanti/drill that referenced this pull request Sep 27, 2015
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.

3 participants