hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iw...@apache.org
Subject incubator-hawq git commit: HAWQ-202. fix bug for metadata cache lock logic
Date Wed, 02 Dec 2015 05:20:16 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master aa268c59e -> 315deab12


HAWQ-202. fix bug for metadata cache lock logic


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/315deab1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/315deab1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/315deab1

Branch: refs/heads/master
Commit: 315deab12831d957378bbf346ab3b1449ee66848
Parents: aa268c5
Author: ivan <iweng@pivotal.io>
Authored: Wed Dec 2 11:35:10 2015 +0800
Committer: ivan <iweng@pivotal.io>
Committed: Wed Dec 2 12:41:10 2015 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbmetadatacache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/315deab1/src/backend/cdb/cdbmetadatacache.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbmetadatacache.c b/src/backend/cdb/cdbmetadatacache.c
index 72be266..dbf1a65 100644
--- a/src/backend/cdb/cdbmetadatacache.c
+++ b/src/backend/cdb/cdbmetadatacache.c
@@ -598,7 +598,7 @@ BlockLocation *GetHdfsFileBlockLocations(const HdfsFileInfo *file_info,
uint64_t
     MetadataCacheEntry *cache_entry = NULL;
     BlockLocation *locations = NULL;
 
-    LWLockAcquire(MetadataCacheLock, LW_EXCLUSIVE);
+    LWLockAcquire(MetadataCacheLock, LW_SHARED);
 
     cache_entry = MetadataCacheExists(file_info);
     if (!cache_entry)
@@ -638,6 +638,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);
                 RemoveHdfsFileBlockLocations(file_info);
                 LWLockRelease(MetadataCacheLock); 
                 


Mime
View raw message