hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gcaragea <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: modify metadata cache read lock logic
Date Thu, 03 Dec 2015 19:20:26 GMT
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.
---

Mime
View raw message