hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject incubator-hawq git commit: HAWQ-386. Remove deprecated catalog table gp_fault_strategy
Date Fri, 19 Feb 2016 02:42:39 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 364809367 -> e33e307ab


HAWQ-386. Remove deprecated catalog table gp_fault_strategy


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

Branch: refs/heads/master
Commit: e33e307abf775cb933c0c5ed84a4f34d226660bf
Parents: 3648093
Author: Ruilong Huo <rhuo@pivotal.io>
Authored: Tue Feb 2 07:32:34 2016 -0800
Committer: Ruilong Huo <rhuo@pivotal.io>
Committed: Fri Feb 19 10:39:10 2016 +0800

----------------------------------------------------------------------
 src/backend/access/index/catquery.c             | 62 --------------------
 src/backend/bootstrap/bootparse.y               |  4 --
 src/backend/catalog/catalog.c                   |  2 -
 src/include/catalog/calico.pl                   |  1 -
 src/include/catalog/gp_san_config.h             | 62 --------------------
 src/include/catalog/pg_type.h                   |  3 -
 src/test/regress/expected/partition.out         |  1 -
 .../regress/expected/partition_optimizer.out    |  1 -
 src/test/regress/output/caql.source             |  1 -
 src/test/regress/output/tidycat.source          |  1 -
 src/test/regress/sql/partition.sql              |  1 -
 tools/bin/gppylib/data/2.0.json                 | 28 ---------
 .../hawqpylib/system/configurationImplHAWQ.py   | 23 +-------
 13 files changed, 2 insertions(+), 188 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/backend/access/index/catquery.c
----------------------------------------------------------------------
diff --git a/src/backend/access/index/catquery.c b/src/backend/access/index/catquery.c
index 471d7b6..c843a11 100644
--- a/src/backend/access/index/catquery.c
+++ b/src/backend/access/index/catquery.c
@@ -752,8 +752,6 @@ cq_lookup (str, len)
 
       {"SELECT oid FROM pg_namespace  WHERE nspname = :1 ", 345, 138, 0, 0, 0, 0, ObjectIdAttributeNumber},
 
-      {"SELECT * FROM gp_fault_strategy ", 97, 53, 0, 0, 0, 0, InvalidAttrNumber},
-
       {"SELECT * FROM pg_depend  WHERE refclassid = :1  AND refobjid = :2  AND refobjsubid
= :3  FOR UPDATE ", 160, 110, 0, 0, 1, 0, InvalidAttrNumber},
 
       {"SELECT * FROM pg_largeobject  WHERE loid = :1  ORDER BY loid, pageno ", 191, 136,
0, 0, 0, 0, InvalidAttrNumber},
@@ -4810,63 +4808,6 @@ caql_basic_fn_52(cqContext *pCtx, cq_list *pcql, bool bLockEntireTable)
 	return (scan);
 }
 
-/* base query: select * from gp_fault_strategy  */
-/* index: *None*  */
-/* clients: 1		i/u/d: 0/0/0 
- *   /src/backend/fts/fts.c: 1
- */
-/* foreign key tables: *None*
- */
-static
-SysScanDesc
-caql_basic_fn_53(cqContext *pCtx, cq_list *pcql, bool bLockEntireTable)
-{
-	SysScanDesc  scan;
-	
-	Relation	rel;
-
-
-	Assert (!pCtx->cq_usesyscache);
-	pCtx->cq_usesyscache = false; /* complain in debug, work in production */
-
-	pCtx->cq_relationId = GpFaultStrategyRelationId;
-
-	if (!pCtx->cq_externrel)
-	{
-		
-		{
-			pCtx->cq_heap_rel = heap_open(pCtx->cq_relationId, 
-										  pCtx->cq_lockmode);
-			pCtx->cq_tupdesc  = RelationGetDescr(pCtx->cq_heap_rel);
-		}
-	}
-	else
-	{
-		/* make sure the supplied relation matches the caql */
-		if (RelationIsValid(pCtx->cq_heap_rel))
-		{
-			Assert(GpFaultStrategyRelationId == 
-				   RelationGetRelid(pCtx->cq_heap_rel));
-			pCtx->cq_tupdesc  = RelationGetDescr(pCtx->cq_heap_rel);
-		}
-
-	}		
-
-	rel = pCtx->cq_heap_rel;
-
-	if (pCtx->cq_usesyscache) return NULL; /* XXX XXX: don't init scan */
-
-	
-
-	scan = systable_beginscan(rel,
-				   InvalidOid,
-				   false,
-				   pCtx->cq_snapshot, 0, pCtx->cq_scanKeys);
-
-
-	return (scan);
-}
-
 /* base query: select * from gp_segment_configuration  */
 /* index: *None*  */
 /* clients: 3		i/u/d: 0/0/0 
@@ -17846,9 +17787,6 @@ cqContext *caql_switch(struct caql_hash_cookie *pchn,
 		case 52: /* select * from gp_fastsequence where objid = :1 and objmod = :2 and contentid
= :3 */
 			pCtx->cq_sysScan = caql_basic_fn_52(pCtx, pcql, false);
 			break;
-		case 53: /* select * from gp_fault_strategy */
-			pCtx->cq_sysScan = caql_basic_fn_53(pCtx, pcql, false);
-			break;
 		case 54: /* select * from gp_segment_configuration */
 			pCtx->cq_sysScan = caql_basic_fn_54(pCtx, pcql, false);
 			break;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/backend/bootstrap/bootparse.y
----------------------------------------------------------------------
diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y
index 74f8471..f734854 100755
--- a/src/backend/bootstrap/bootparse.y
+++ b/src/backend/bootstrap/bootparse.y
@@ -312,10 +312,6 @@ Boot_CreateStmt:
 							case GpSanConfigRelationId:
 								typid = GP_SAN_CONFIGURATION_RELTYPE_OID;
 								break;
-/* relation id: 5039 - gp_fault_strategy 20101104 */
-							case GpFaultStrategyRelationId:
-								typid = GP_FAULT_STRATEGY_RELTYPE_OID;
-								break;
 /* relation id: 5096 - gp_global_sequence 20101104 */
 							case GpGlobalSequenceRelationId:
 								typid = GP_GLOBAL_SEQUENCE_RELTYPE_OID;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/backend/catalog/catalog.c
----------------------------------------------------------------------
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index ba65d88..4af2c28 100755
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -775,8 +775,6 @@ relationId == AuthIdRelationId ||
 relationId == GpMasterMirroringRelationId || 
 /* relation id: 5035 - gp_san_configuration 20101104 */
 relationId == GpSanConfigRelationId || 
-/* relation id: 5039 - gp_fault_strategy 20101104 */
-relationId == GpFaultStrategyRelationId || 
 /* relation id: 5000 - gp_configuration 20101104 */
 relationId == GpConfigurationRelationId || 
 /* relation id: 5006 - gp_configuration_history 20101104 */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/include/catalog/calico.pl
----------------------------------------------------------------------
diff --git a/src/include/catalog/calico.pl b/src/include/catalog/calico.pl
index 28612b0..207950b 100755
--- a/src/include/catalog/calico.pl
+++ b/src/include/catalog/calico.pl
@@ -3878,7 +3878,6 @@ static void caql_lockwell(cqContext		*pCtx,
 
 //	SET_LOCKTAG_RELATION(tag, dbid, relid);
 	/* use gp_san_configuration for now */
-	SET_LOCKTAG_RELATION(tag, dbid, GpFaultStrategyRelationId);
 
 	Oid keyoid = hashoid;
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/include/catalog/gp_san_config.h
----------------------------------------------------------------------
diff --git a/src/include/catalog/gp_san_config.h b/src/include/catalog/gp_san_config.h
index 2e09358..2a63689 100644
--- a/src/include/catalog/gp_san_config.h
+++ b/src/include/catalog/gp_san_config.h
@@ -30,68 +30,6 @@
 #ifndef _GP_SAN_CONFIG_H_
 #define _GP_SAN_CONFIG_H_
 
-/*
- * Defines for gp_fault_strategy table.
- */
-#define GpFaultStrategy		"gp_fault_strategy"
-
-/* TIDYCAT_BEGINDEF
-
-   CREATE TABLE gp_fault_strategy
-   with (camelcase=GpFaultStrategy, shared=true, oid=false, relid=5039, reltype_oid=6443,
content=MASTER_ONLY)
-   (
-   fault_strategy "char"
-   );
-
-   TIDYCAT_ENDDEF
-*/
-/* TIDYCAT_BEGIN_CODEGEN 
-
-   WARNING: DO NOT MODIFY THE FOLLOWING SECTION: 
-   Generated by tidycat.pl version 21.
-   on Wed Nov 24 14:21:44 2010
-*/
-
-
-/*
- TidyCat Comments for gp_fault_strategy:
-  Table is shared, so catalog.c:IsSharedRelation is updated.
-  Table does not have an Oid column.
-  Table has static type (see pg_types.h).
-  Table contents are only maintained on MASTER.
-
-*/
-
-/* ----------------
- *		gp_fault_strategy definition.  cpp turns this into
- *		typedef struct FormData_gp_fault_strategy
- * ----------------
- */
-#define GpFaultStrategyRelationId	5039
-
-CATALOG(gp_fault_strategy,5039) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
-{
-	char	fault_strategy;	
-} FormData_gp_fault_strategy;
-
-
-/* ----------------
- *		Form_gp_fault_strategy corresponds to a pointer to a tuple with
- *		the format of gp_fault_strategy relation.
- * ----------------
- */
-typedef FormData_gp_fault_strategy *Form_gp_fault_strategy;
-
-
-/* ----------------
- *		compiler constants for gp_fault_strategy
- * ----------------
- */
-#define Natts_gp_fault_strategy					1
-#define Anum_gp_fault_strategy_fault_strategy	1
-
-
-/* TIDYCAT_END_CODEGEN */
 
 /*
  * Defines for gp_san_config table.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/include/catalog/pg_type.h
----------------------------------------------------------------------
diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h
index 4960bdb..33e80c9 100644
--- a/src/include/catalog/pg_type.h
+++ b/src/include/catalog/pg_type.h
@@ -718,9 +718,6 @@ DATA(insert OID = 6452 (pg_foreign_table PGNSP PGUID -1 f c t \054 2879
0 record
 /* relation id: 5035 - gp_san_configuration 20101104 */
 DATA(insert OID = 6444 ( gp_san_configuration	    PGNSP PGUID -1 f c t \054 5035 0 record_in
record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));	
 #define GP_SAN_CONFIGURATION_RELTYPE_OID 6444
-/* relation id: 5039 - gp_fault_strategy 20101104 */
-DATA(insert OID = 6443 ( gp_fault_strategy	    PGNSP PGUID -1 f c t \054 5039 0 record_in
record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));	
-#define GP_FAULT_STRATEGY_RELTYPE_OID 6443
 /* relation id: 5096 - gp_global_sequence 20101104 */
 DATA(insert OID = 6995 ( gp_global_sequence	    PGNSP PGUID -1 f c t \054 5096 0 record_in
record_out record_recv record_send - d x f 0 -1 0 _null_ _null_ ));	
 #define GP_GLOBAL_SEQUENCE_RELTYPE_OID 6995

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/test/regress/expected/partition.out
----------------------------------------------------------------------
diff --git a/src/test/regress/expected/partition.out b/src/test/regress/expected/partition.out
index c03e5fa..f3bcded 100755
--- a/src/test/regress/expected/partition.out
+++ b/src/test/regress/expected/partition.out
@@ -5528,7 +5528,6 @@ locktype from
 pg_locks l left outer join pg_class c on (l.relation = c.oid),
 pg_database d where relation is not null and l.database = d.oid and 
 l.gp_segment_id = -1 and
-relname != 'gp_fault_strategy' and
 d.datname = current_database() order by 1, 3, 2;
 -- end_ignore
 -- Partitioned table with toast table

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/test/regress/expected/partition_optimizer.out
----------------------------------------------------------------------
diff --git a/src/test/regress/expected/partition_optimizer.out b/src/test/regress/expected/partition_optimizer.out
index cb834b5..e6a8fb9 100644
--- a/src/test/regress/expected/partition_optimizer.out
+++ b/src/test/regress/expected/partition_optimizer.out
@@ -5528,7 +5528,6 @@ locktype from
 pg_locks l left outer join pg_class c on (l.relation = c.oid),
 pg_database d where relation is not null and l.database = d.oid and 
 l.gp_segment_id = -1 and
-l.relation != 5039 and     -- XXX XXX: ignore gp_fault_strategy
 d.datname = current_database() order by 1, 3, 2;
 -- end_ignore
 -- Partitioned table with toast table

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/test/regress/output/caql.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/caql.source b/src/test/regress/output/caql.source
index d518963..7245604 100644
--- a/src/test/regress/output/caql.source
+++ b/src/test/regress/output/caql.source
@@ -411,7 +411,6 @@ WARNING:  skipping "gp_id" --- only table or database owner can vacuum
it
 WARNING:  skipping "gp_distribution_policy" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_version_at_initdb" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_segment_configuration" --- only table or database owner can vacuum
it
-WARNING:  skipping "gp_fault_strategy" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_san_configuration" --- only table or database owner can vacuum it
 WARNING:  skipping "gp_verification_history" --- only table or database owner can vacuum
it
 -- end_ignore

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/test/regress/output/tidycat.source
----------------------------------------------------------------------
diff --git a/src/test/regress/output/tidycat.source b/src/test/regress/output/tidycat.source
index 1b0a2d9..1e9ef96 100644
--- a/src/test/regress/output/tidycat.source
+++ b/src/test/regress/output/tidycat.source
@@ -82,7 +82,6 @@ order by relname;
  gp_db_interfaces
  gp_distribution_policy
  gp_fastsequence
- gp_fault_strategy
  gp_global_sequence
  gp_id
  gp_interfaces

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/src/test/regress/sql/partition.sql
----------------------------------------------------------------------
diff --git a/src/test/regress/sql/partition.sql b/src/test/regress/sql/partition.sql
index d5f4515..9fa893c 100644
--- a/src/test/regress/sql/partition.sql
+++ b/src/test/regress/sql/partition.sql
@@ -2968,7 +2968,6 @@ locktype from
 pg_locks l left outer join pg_class c on (l.relation = c.oid),
 pg_database d where relation is not null and l.database = d.oid and 
 l.gp_segment_id = -1 and
-l.relation != 5039 and     -- XXX XXX: ignore gp_fault_strategy
 d.datname = current_database() order by 1, 3, 2;
 -- end_ignore
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/tools/bin/gppylib/data/2.0.json
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/data/2.0.json b/tools/bin/gppylib/data/2.0.json
index 3fbd349..e4e989c 100644
--- a/tools/bin/gppylib/data/2.0.json
+++ b/tools/bin/gppylib/data/2.0.json
@@ -280,34 +280,6 @@
          "text" : "with (camelcase=GpPolicy, oid=false, relid=5002, content=MASTER_ONLY)"
       }
    },
-   "gp_fault_strategy" : {
-      "CamelCaseRelationId" : "GpFaultStrategyRelationId",
-      "UppercaseReltypeOid" : "GP_FAULT_STRATEGY_RELTYPE_OID",
-      "colh" : {
-         "fault_strategy" : "char"
-      },
-      "cols" : [
-         {
-            "colname" : "fault_strategy",
-            "ctype" : "char",
-            "precomment" : "\n**TK_BLANK_LINE**",
-            "sqltype" : "quoted_char"
-         }
-      ],
-      "filename" : "gp_san_config.h",
-      "relid_comment_tag" : "/* relation id: 5039 - gp_fault_strategy */\n",
-      "tabdef_text" : "\n   CREATE TABLE gp_fault_strategy\n   with (camelcase=GpFaultStrategy,
shared=true, oid=false, relid=5039, reltype_oid=6443, content=MASTER_ONLY)\n   (\n   fault_strategy
\"char\"\n   )",
-      "with" : {
-         "bootstrap" : 0,
-         "camelcase" : "GpFaultStrategy",
-         "content" : "MASTER_ONLY",
-         "oid" : "",
-         "relid" : "5039",
-         "reltype_oid" : "6443",
-         "shared" : "1",
-         "text" : "with (camelcase=GpFaultStrategy, shared=true, oid=false, relid=5039, reltype_oid=6443,
content=MASTER_ONLY)"
-      }
-   },
    "gp_global_sequence" : {
       "CamelCaseRelationId" : "GpGlobalSequenceRelationId",
       "UppercaseReltypeOid" : "GP_GLOBAL_SEQUENCE_RELTYPE_OID",

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e33e307a/tools/bin/hawqpylib/system/configurationImplHAWQ.py
----------------------------------------------------------------------
diff --git a/tools/bin/hawqpylib/system/configurationImplHAWQ.py b/tools/bin/hawqpylib/system/configurationImplHAWQ.py
index cf0b656..79c9efd 100644
--- a/tools/bin/hawqpylib/system/configurationImplHAWQ.py
+++ b/tools/bin/hawqpylib/system/configurationImplHAWQ.py
@@ -171,16 +171,11 @@ class GpConfigurationProviderUsingHAWQCatalog(GpConfigurationProvider)
:
             originalSeg = update.dbsegmap.get(seg.getRegistrationOrder())
             self.__updateSystemConfigUpdateSegment(conn, hawqArray, seg, originalSeg, textForConfigTable)
 
-        # apply update to fault strategy
-        if hawqArray.getStrategyAsLoadedFromDb() != hawqArray.getFaultStrategy():
-            self.__updateSystemConfigFaultStrategy(conn, hawqArray)
-
         # commit changes
         logger.debug("Committing configuration table changes")
         dbconn.execSQL(conn, "COMMIT")
         conn.close()
 
-        hawqArray.setStrategyAsLoadedFromDb( [hawqArray.getFaultStrategy()])
         hawqArray.setSegmentsAsLoadedFromDb([seg.copy() for seg in hawqArray.getDbList()])
 
 
@@ -276,12 +271,8 @@ class GpConfigurationProviderUsingHAWQCatalog(GpConfigurationProvider)
:
         # update mode and status
         # when adding a mirror, the replication port may change as well
         #
-        if hawqArray.getFaultStrategy() == hawqarray.FAULT_STRATEGY_NONE:
-            what = "%s: segment hostname and address"
-            self.__updateSegmentAddress(conn, seg)
-        else:
-            what = "%s: segment mode and status"
-            self.__updateSegmentModeStatus(conn, seg)
+        what = "%s: segment hostname and address"
+        self.__updateSegmentAddress(conn, seg)
 
         if seg.getReplicationPort() != originalSeg.getReplicationPort():
             what = "%s: segment mode, status, and replication port"
@@ -290,16 +281,6 @@ class GpConfigurationProviderUsingHAWQCatalog(GpConfigurationProvider)
:
         self.__insertConfigHistory(conn, seg.getRegistrationOrder(), what % textForConfigTable)
 
 
-    def __updateSystemConfigFaultStrategy(self, conn, hawqArray):
-        """
-        Update the fault strategy.
-        """
-        fs  = hawqArray.getFaultStrategy()
-        sql = "UPDATE gp_fault_strategy\n SET fault_strategy = " + self.__toSqlCharValue(fs)
+ "\n"
-        logger.debug(sql)
-        dbconn.executeUpdateOrInsert(conn, sql, 1)
-
-
     def __callSegmentRemoveMirror(self, conn, seg):
         """
         Call gp_remove_segment_mirror() to remove the mirror.


Mime
View raw message