hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ztao1...@apache.org
Subject incubator-hawq git commit: HAWQ-512. Fix query hang due to deadlock in entrydb catalog access
Date Thu, 10 Mar 2016 10:50:23 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master cb7caf540 -> 88bf600a0


HAWQ-512. Fix query hang due to deadlock in entrydb catalog access


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

Branch: refs/heads/master
Commit: 88bf600a093d11fcc7c50c8dd934dd1a96f88cd7
Parents: cb7caf5
Author: zhenglin tao <zhenglin.taozl@gmail.com>
Authored: Thu Mar 10 18:20:16 2016 +0800
Committer: zhenglin tao <zhenglin.taozl@gmail.com>
Committed: Thu Mar 10 18:21:36 2016 +0800

----------------------------------------------------------------------
 src/backend/tcop/postgres.c        | 7 +++++--
 src/backend/utils/cache/relcache.c | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/88bf600a/src/backend/tcop/postgres.c
----------------------------------------------------------------------
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index f9b2d57..6b9d8f1 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -4325,9 +4325,12 @@ PostgresMain(int argc, char *argv[], const char *username)
 	ereport(DEBUG3,
 			(errmsg_internal("InitPostgres")));
 
-	/* This is the initdb process */
+	/* This is the initdb process
+	 *
+	 * NOTE: we init entrydb as QE
+	 */
 	if (MyProcPort == NULL ||
-	    AmIMaster() || AmIStandby() ||
+	    (AmIMaster() && Gp_role != GP_ROLE_EXECUTE) || AmIStandby() ||
 	    MyProcPort->bootstrap_user == NULL){
 		am_superuser = InitPostgres(dbname, InvalidOid, username, NULL);
 	}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/88bf600a/src/backend/utils/cache/relcache.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 0121b5e..1a41090 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -1342,7 +1342,7 @@ RelationInitPhysicalAddr(Relation relation)
 	if (relation->rd_rel->relisshared)
 		relation->rd_node.dbNode = InvalidOid;
 	else if (relation->rd_id < FirstNormalObjectId ||
-			AmActiveMaster() ||
+			(AmActiveMaster() && Gp_role != GP_ROLE_EXECUTE) ||
 			AmStandbyMaster())
 		relation->rd_node.dbNode = MyDatabaseId;
 	else


Mime
View raw message