hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lil...@apache.org
Subject incubator-hawq git commit: HAWQ-572. Add fault injection test cases for QE side
Date Wed, 23 Mar 2016 01:47:27 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master a84d55c34 -> 31fdef71c


HAWQ-572. Add fault injection test cases for QE side


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

Branch: refs/heads/master
Commit: 31fdef71c1d77070b1db84d37c460127487456cd
Parents: a84d55c
Author: Chunling Wang <wangchunling14@126.com>
Authored: Tue Mar 22 16:49:07 2016 +0800
Committer: Chunling Wang <wangchunling14@126.com>
Committed: Tue Mar 22 16:49:07 2016 +0800

----------------------------------------------------------------------
 src/backend/access/parquet/parquetam.c         | 9 +++++++++
 src/backend/cdb/dispatcher.c                   | 9 +++++++++
 src/backend/tcop/pquery.c                      | 9 +++++++++
 src/backend/utils/misc/faultinjector.c         | 9 +++++++++
 src/include/utils/faultinjector.h              | 3 +++
 tools/bin/gppylib/programs/clsInjectFault.py   | 3 +++
 tools/bin/hawqpylib/programs/clsInjectFault.py | 3 +++
 7 files changed, 45 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/src/backend/access/parquet/parquetam.c
----------------------------------------------------------------------
diff --git a/src/backend/access/parquet/parquetam.c b/src/backend/access/parquet/parquetam.c
index 3c2b7df..a01f89b 100644
--- a/src/backend/access/parquet/parquetam.c
+++ b/src/backend/access/parquet/parquetam.c
@@ -33,6 +33,7 @@
 #include "utils/relcache.h"
 #include "utils/tqual.h"
 #include "utils/rel.h"
+#include "utils/faultinjector.h"
 #include "access/aomd.h"
 #include "cdb/cdbvars.h"
 #include "cdb/cdbparquetam.h"
@@ -149,6 +150,14 @@ parquet_beginscan(
 	scan->aoEntry = aoEntry;
 	Assert(aoEntry->majorversion == 1 && aoEntry->minorversion == 0);
 
+#ifdef FAULT_INJECTOR
+				FaultInjector_InjectFaultIfSet(
+											   FailQeWhenBeginParquetScan,
+											   DDLNotSpecified,
+											   "",	// databaseName
+											   ""); // tableName
+#endif
+
 	/*
 	 * initialize the scan descriptor
 	 */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/src/backend/cdb/dispatcher.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/dispatcher.c b/src/backend/cdb/dispatcher.c
index 55a7823..d9d0771 100644
--- a/src/backend/cdb/dispatcher.c
+++ b/src/backend/cdb/dispatcher.c
@@ -1236,6 +1236,15 @@ dispatch_run(DispatchData *data)
 	INSTR_TIME_SET_CURRENT(data->time_begin);
 	if (!dispatcher_bind_executor(data))
 		goto error;
+
+#ifdef FAULT_INJECTOR
+				FaultInjector_InjectFaultIfSet(
+											   FaillQeAfterConnection,
+											   DDLNotSpecified,
+											   "",	// databaseName
+											   ""); // tableName
+#endif
+
 	/*
 	 * Only after we have the executors, we can serialize the state. Or we
 	 * don't know the executor listening address.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/src/backend/tcop/pquery.c
----------------------------------------------------------------------
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index f097f01..99b6a1d 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -43,6 +43,7 @@
 #include "tcop/pquery.h"
 #include "tcop/tcopprot.h"
 #include "tcop/utility.h"
+#include "utils/faultinjector.h"
 #include "utils/memutils.h"
 #include "utils/resscheduler.h"
 #include "commands/vacuum.h"
@@ -1410,6 +1411,14 @@ PortalRun(Portal portal, int64 count, bool isTopLevel,
 
 	AssertArg(PortalIsValid(portal));
 
+#ifdef FAULT_INJECTOR
+				FaultInjector_InjectFaultIfSet(
+											   FailQeWhenDoQuery,
+											   DDLNotSpecified,
+											   "",	// databaseName
+											   ""); // tableName
+#endif
+
 	/* Initialize completion tag to empty string */
 	if (completionTag)
 		completionTag[0] = '\0';

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/src/backend/utils/misc/faultinjector.c
----------------------------------------------------------------------
diff --git a/src/backend/utils/misc/faultinjector.c b/src/backend/utils/misc/faultinjector.c
index f5ab5bc..a760b4d 100644
--- a/src/backend/utils/misc/faultinjector.c
+++ b/src/backend/utils/misc/faultinjector.c
@@ -287,6 +287,12 @@ FaultInjectorIdentifierEnumToString[] = {
 		/* inject fault when create cdb dispatch result object, set out of memory */
 	_("worker_manager_submit_job"),
 		/* inject fault when worker manager submit job , set error*/
+	_("fail_qe_after_connection"),
+		/* inject fault after connecting to QD, sleep to wait QE fail */
+	_("fail_qe_when_do_query"),
+		/* inject fault when QE actually working, set error */
+	_("fail_qe_when_begin_parquet_scan"),
+		/* inject fault when begin scan parquet table, set error */
 /*	_("make_dispatch_thread"),
 		 inject fault when initialing memory structure for dispatcher thread*/
 	_("before_dispatch"),
@@ -1077,6 +1083,7 @@ FaultInjector_NewHashEntry(
 		case ConnectionFailAfterGangCreation:
 		case CreateCdbDispathResultObject:
 		case WorkerManagerSubmitJob:
+		case FaillQeAfterConnection:
 
 			/* These faults are designed for master. */
 			if(!AmIMaster())
@@ -1102,6 +1109,8 @@ FaultInjector_NewHashEntry(
 		case SegmentProbeResponse:
 		/* We do not use vmem on master. Therefore, we only attempt large palloc on segments. */
 		case MultiExecHashLargeVmem:
+		case FailQeWhenDoQuery:
+		case FailQeWhenBeginParquetScan:
 			/* SEGMENT */
 			if(!AmISegment())
 			{

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/src/include/utils/faultinjector.h
----------------------------------------------------------------------
diff --git a/src/include/utils/faultinjector.h b/src/include/utils/faultinjector.h
index ca9c278..8f94349 100644
--- a/src/include/utils/faultinjector.h
+++ b/src/include/utils/faultinjector.h
@@ -190,6 +190,9 @@ typedef enum FaultInjectorIdentifier_e {
 /*	MakeDispatchThread,*/
 	CreateCdbDispathResultObject,
 	WorkerManagerSubmitJob,
+	FaillQeAfterConnection,
+	FailQeWhenDoQuery,
+	FailQeWhenBeginParquetScan,
 
 	BeforeDispatch,
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/tools/bin/gppylib/programs/clsInjectFault.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/programs/clsInjectFault.py b/tools/bin/gppylib/programs/clsInjectFault.py
index 6f097d8..8c166bb 100644
--- a/tools/bin/gppylib/programs/clsInjectFault.py
+++ b/tools/bin/gppylib/programs/clsInjectFault.py
@@ -408,6 +408,9 @@ class GpInjectFaultProgram:
                   "connection_fail_after_gang_creation (inject fault after gang thread creation,
set connection null)" \
 				  "create_cdb_dispath_result_object (inject fault when create cdb dispatch result object,
set out of memeory)" \
 				  "worker_manager_submit_job (inject fault when worker manager submit job , set error)"
\
+				  "fail_qe_after_connection (inject fault after connecting to QD, sleep to wait QE fail)"
\
+				  "fail_qe_when_do_query (inject fault when QE actually working, set error)" \
+				  "fail_qe_when_begin_parquet_scan (inject fault when begin scan parquet table, set error)"\
 				  "all (affects all faults injected, used for 'status' and 'reset'), ")
         addTo.add_option("-c", "--ddl_statement", dest="ddlStatement", type="string",
                          metavar="ddlStatement",

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/31fdef71/tools/bin/hawqpylib/programs/clsInjectFault.py
----------------------------------------------------------------------
diff --git a/tools/bin/hawqpylib/programs/clsInjectFault.py b/tools/bin/hawqpylib/programs/clsInjectFault.py
index 8992f9d..e1944fb 100644
--- a/tools/bin/hawqpylib/programs/clsInjectFault.py
+++ b/tools/bin/hawqpylib/programs/clsInjectFault.py
@@ -416,6 +416,9 @@ class HAWQInjectFaultProgram:
                   "connection_fail_after_gang_creation (inject fault after gang thread creation,
set connection null)" \
 				  "create_cdb_dispath_result_object (inject fault when create cdb dispatch result object,
set out of memory)" \
                   "worker_manager_submit_job (inject fault when worker manager submit job
, set error)" \
+				  "fail_qe_after_connection (inject fault after connecting to QD, sleep to wait QE fail)"
\
+				  "fail_qe_when_do_query (inject fault when QE actually working, set error)" \
+				  "fail_qe_when_begin_parquet_scan (inject fault when begin scan parquet table, set error)"\
 				  "all (affects all faults injected, used for 'status' and 'reset'), ")
         addTo.add_option("-c", "--ddl_statement", dest="ddlStatement", type="string",
                          metavar="ddlStatement",


Mime
View raw message