You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by foyzur <gi...@git.apache.org> on 2016/04/01 19:20:13 UTC

[GitHub] incubator-hawq pull request: HAWQ-621. Fixing tuple descriptor lea...

GitHub user foyzur opened a pull request:

    https://github.com/apache/incubator-hawq/pull/549

    HAWQ-621. Fixing tuple descriptor leak in split_rows during an ALTER TABLE SPLIT PARTITION. 

    During split_rows, we may create new tuple table slot inside reconstructMatchingTupleSlot() if the descriptor of the new target relation does not match the source relation. We then cache this slot inside the target relation's ri_resultSlot. This process pins the tuple descriptor of the new target relation. However, at the end of split_rows, when we are finished with this "cached" tuple table slot, we don't free them. This results in a WARNING that we leaked a tuple descriptor.
    
    
    Solution:
    -----------
    
    Following the call path of split_rows, the method split_rows() is only called from 
    
    ```
    split_rows(Relation, Relation, Relation) : void
    	ATPExecPartSplit(Relation *, AlterPartitionCmd *) : void
    		ATExecCmd(List * *, AlteredTableInfo *, Relation *, AlterTableCmd *) : void
    			ATPExecPartAlter(List * *, AlteredTableInfo *, Relation, AlterPartitionCmd *) : void
    			ATRewriteCatalogs(List * *) : void
    ```
    
    By the time we call split_rows, we know precisely the two relation where we will be inserting into. We create ResultRelInfo for both of these relations (the two target relations) at the beginning of split_rows(), called rria, and rrib. Both of these ResultRelInfo only have lifespan of the containing method split_rows(). We use the ri_resultSlot of these two rria and rrib to cache the TupleTableSlot inside reconstructMatchingTupleSlot() where we create additional TupleTableSlot using the tuple descriptors of the two target relations, therefore pinning these two target relation's TupleDesc. As the rria and rrib only live during split_rows() and only used for all the tuples in ONE CALL of split_rows(), we can easily drop the additional TupleTableSlot ri_resultSlot of both rria and rrib, and that will also unpin underlying TupleDesc.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/foyzur/incubator-hawq tupledesc

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/549.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #549
    
----
commit 88085577d226efb60b4c1e8ecdec6187816c8f1e
Author: Foyzur Rahman <fo...@gmail.com>
Date:   2016-03-22T01:11:13Z

    HAWQ-621. Fixing tuple descriptor leak in split_rows during an ALTER TABLE SPLIT PARTITION.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-621. Fixing tuple descriptor lea...

Posted by changleicn <gi...@git.apache.org>.
Github user changleicn commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/549#issuecomment-208089212
  
    @foyzur could you close this PR. thank!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-621. Fixing tuple descriptor lea...

Posted by liming01 <gi...@git.apache.org>.
Github user liming01 commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/549#issuecomment-206671144
  
    Looks fine. +1. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-621. Fixing tuple descriptor lea...

Posted by liming01 <gi...@git.apache.org>.
Github user liming01 commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/549#issuecomment-206672236
  
    @foyzur , merged into master branch. please close this PR. Thank.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-621. Fixing tuple descriptor lea...

Posted by foyzur <gi...@git.apache.org>.
Github user foyzur closed the pull request at:

    https://github.com/apache/incubator-hawq/pull/549


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---