You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by hu...@apache.org on 2015/11/19 03:09:49 UTC

incubator-hawq git commit: HAWQ-166. Fix orphaned share input scan QE process after OLAP grouping query

Repository: incubator-hawq
Updated Branches:
  refs/heads/master be9a74bea -> e5afa4e2b


HAWQ-166. Fix orphaned share input scan QE process after OLAP grouping query


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

Branch: refs/heads/master
Commit: e5afa4e2be5a966ecf9cc8d8b4225f333bf3a3a7
Parents: be9a74b
Author: Ruilong Huo <rh...@pivotal.io>
Authored: Tue Nov 17 10:52:33 2015 +0800
Committer: Ruilong Huo <rh...@pivotal.io>
Committed: Thu Nov 19 10:09:02 2015 +0800

----------------------------------------------------------------------
 src/backend/executor/nodeShareInputScan.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e5afa4e2/src/backend/executor/nodeShareInputScan.c
----------------------------------------------------------------------
diff --git a/src/backend/executor/nodeShareInputScan.c b/src/backend/executor/nodeShareInputScan.c
index 7bc3037..334e694 100644
--- a/src/backend/executor/nodeShareInputScan.c
+++ b/src/backend/executor/nodeShareInputScan.c
@@ -22,6 +22,7 @@
 
 #include "postgres.h"
 
+#include "access/xact.h"
 #include "cdb/cdbvars.h"
 #include "executor/executor.h"
 #include "executor/nodeShareInputScan.h"
@@ -945,6 +946,21 @@ shareinput_writer_waitdone(void *ctxt, int share_id, int nsharer_xslice)
 	while(ack_needed > 0)
 	{
 		CHECK_FOR_INTERRUPTS();
+
+		/*
+		 * Writer won't wait for data reading done notification from readers if transaction is
+		 * aborting. Readers may fail to send data reading done notification to writer in two
+		 * cases:
+		 *
+		 *    1. The transaction is aborted due to interrupts or exceptions, i.e., user cancels
+		 *       query, division by zero on some segment
+		 *
+		 *    2. Logic errors in reader which incur its unexpected exit, i.e., segmentation fault
+		 */
+		if (IsAbortInProgress())
+		{
+			break;
+		}
 	
 		MPP_FD_ZERO(&rset);
 		MPP_FD_SET(pctxt->donefd, &rset);