You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by liming01 <gi...@git.apache.org> on 2017/03/28 07:57:22 UTC

[GitHub] incubator-hawq pull request #1198: HAWQ-1417. Fixed crash when ANALYZE after...

GitHub user liming01 opened a pull request:

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

    HAWQ-1417. Fixed crash when ANALYZE after COPY because of invalid res\u2026

    \u2026ource owner
    
    The root cause is:  when ANALYZE is running, it will commit previous transaction, and begin one transaction for each relation to process analyze. However some code added before begining transactions, which means in this time, no transaction, and no resource owner either.
    
    The solution is to: create one resource owner for analyzeStmt(), and delete it after processing it.

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

    $ git pull https://github.com/liming01/incubator-hawq mli/crash_analyze_resowner

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

    https://github.com/apache/incubator-hawq/pull/1198.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 #1198
    
----
commit 5affd9e5ab63f60ba6e09c2fd0c90f5351f2d5b0
Author: Ming LI <ml...@apache.org>
Date:   2017-03-28T07:52:02Z

    HAWQ-1417. Fixed crash when ANALYZE after COPY because of invalid resource owner

----


---
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 #1198: HAWQ-1417. Fixed crash when ANALYZE after...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1198#discussion_r108427680
  
    --- Diff: src/backend/commands/analyze.c ---
    @@ -476,6 +477,11 @@ void analyzeStmt(VacuumStmt *stmt, List *relids, int preferred_seg_num)
     		MemoryContextSwitchTo(analyzeStatementContext);
     	}
     
    +	// Create a resource owner to keep track of our resources even not in trasaction block
    --- End diff --
    
    Use /* */ to keep it consistent


---
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 issue #1198: HAWQ-1417. Fixed crash when ANALYZE after COPY b...

Posted by wengyanqing <gi...@git.apache.org>.
Github user wengyanqing commented on the issue:

    https://github.com/apache/incubator-hawq/pull/1198
  
    +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 issue #1198: HAWQ-1417. Fixed crash when ANALYZE after COPY b...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on the issue:

    https://github.com/apache/incubator-hawq/pull/1198
  
    The fix looks good. Is it possible to add unit test for it in src/test/unit/mock/backend/commands/analyze_mock.c?


---
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 issue #1198: HAWQ-1417. Fixed crash when ANALYZE after COPY b...

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

    https://github.com/apache/incubator-hawq/pull/1198
  
    After investigation, it seems we can not use cmock to reproduce HAWQ-1417.
    The reason is: we need to mock all functions called in these functions, and also we need make one relation with catalog in memory, and data on disk.
    I looked into some unit tests exists in backend, all tests are testing simple logic, and calling some independent modules, so the functions need to be mocked is very limited.


---
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 issue #1198: HAWQ-1417. Fixed crash when ANALYZE after COPY b...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on the issue:

    https://github.com/apache/incubator-hawq/pull/1198
  
    @liming01, the mock file for analyze is generated. The way to add mock is at: https://github.com/apache/incubator-hawq/blob/master/src/test/unit/README.txt. Please take a look and see if it is good to leverage mock for your fix.
    
    The mock test is covered in hawq ci. You can do that in local environment also: cd src/backend; make unittest-check
    
    If it is hard to reproduce the issue with sql, I think mock is an option we can try.


---
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 issue #1198: HAWQ-1417. Fixed crash when ANALYZE after COPY b...

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

    https://github.com/apache/incubator-hawq/pull/1198
  
    (1) no file in master branch: src/test/unit/mock/backend/commands/analyze_mock.c
    (2) Do we run CI on these mock test now?


---
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 #1198: HAWQ-1417. Fixed crash when ANALYZE after...

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

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


---
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 issue #1198: HAWQ-1417. Fixed crash when ANALYZE after COPY b...

Posted by huor <gi...@git.apache.org>.
Github user huor commented on the issue:

    https://github.com/apache/incubator-hawq/pull/1198
  
    +1 for the fix as the mock of the verification is not feasible


---
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.
---