You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by wengyanqing <gi...@git.apache.org> on 2015/12/02 04:15:06 UTC

[GitHub] incubator-hawq pull request: modify metadata cache read lock logic

GitHub user wengyanqing opened a pull request:

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

    modify metadata cache read lock logic

    modify metadata cache lock logic when check item exists

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

    $ git pull https://github.com/wengyanqing/incubator-hawq metadatacache

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

    https://github.com/apache/incubator-hawq/pull/146.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 #146
    
----
commit b58e893ed37978249cbb279d398eac73cf002880
Author: ivan <iw...@pivotal.io>
Date:   2015-12-02T03:06:37Z

    modify metadata cache read lock logic

----


---
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: modify metadata cache read lock logic

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

    https://github.com/apache/incubator-hawq/pull/146#discussion_r46597216
  
    --- Diff: src/backend/cdb/cdbmetadatacache.c ---
    @@ -619,6 +619,9 @@ BlockLocation *GetHdfsFileBlockLocations(const HdfsFileInfo *file_info, uint64_t
                 if (cache_entry->block_num <= 1)
                 {
                     // only one file, re-fetch 
    +                LWLockRelease(MetadataCacheLock); 
    +                
    +                LWLockAcquire(MetadataCacheLock, LW_EXCLUSIVE);
    --- End diff --
    
    Can this create deadlock situations? Upgrading locks usually is a tricky situation, can lead to a situation where:
    - proc A has SHARED lock on foo and bar
    - proc B has SHARED lock on foo and bar
    
    - proc A requests EXCLUSIVE lock on foo and gets it
    - proc B requests EXCLUSIVE lock on bar and gets it
    - proc A requests EXCLUSIVE lock on bar and waits
    - proc B requests EXCLUSIVE lock on foo and waits - deadlock
    
    



---
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: modify metadata cache read lock logic

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

    https://github.com/apache/incubator-hawq/pull/146#issuecomment-161167070
  
    +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: modify metadata cache read lock logic

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

    https://github.com/apache/incubator-hawq/pull/146#discussion_r46654739
  
    --- Diff: src/backend/cdb/cdbmetadatacache.c ---
    @@ -619,6 +619,9 @@ BlockLocation *GetHdfsFileBlockLocations(const HdfsFileInfo *file_info, uint64_t
                 if (cache_entry->block_num <= 1)
                 {
                     // only one file, re-fetch 
    +                LWLockRelease(MetadataCacheLock); 
    +                
    +                LWLockAcquire(MetadataCacheLock, LW_EXCLUSIVE);
    --- End diff --
    
    Hi George,
    
    Thanks for your comment. It only has one lock (MetadataCacheLock) and one resource (MetadataCache) which lock on, so it should not cause dead lock.



---
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: modify metadata cache read lock logic

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

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


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