Skip to content

Commit 4a0af58

Browse files
authored
Fix gpinitsystem (#490)
* Fix gpinitsystem check if is is_external_fts in some places * Remove guc gp_cbdb_deploy
1 parent c87fc6d commit 4a0af58

File tree

13 files changed

+3
-38
lines changed

13 files changed

+3
-38
lines changed

gpMgmt/bin/gpaddmirrors

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ from gppylib.programs.clsAddMirrors import *
1414

1515
#-------------------------------------------------------------------------
1616
if __name__ == '__main__':
17-
check_deployment_mode('gpaddmirrors')
1817
simple_main( GpAddMirrorsProgram.createParser, GpAddMirrorsProgram.createProgram)

gpMgmt/bin/gpinitsystem

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,20 +2093,9 @@ CREATE_FTS() {
20932093
fi
20942094
}
20952095

2096-
CHECK_DEPLOYMENT_MODE() {
2097-
if [[ -n "${COORDINATOR_DIRECTORY}/${SEG_PREFIX}-1" && -f ${COORDINATOR_DIRECTORY}/${SEG_PREFIX}-1/postgresql.conf ]]; then
2098-
gp_cbdb_deploy=`grep gp_cbdb_deploy ${COORDINATOR_DIRECTORY}/${SEG_PREFIX}-1/postgresql.conf | awk -F= '{print $1}'`
2099-
deployment_mode=`grep gp_cbdb_deploy ${COORDINATOR_DIRECTORY}/${SEG_PREFIX}-1/postgresql.conf | awk -F= '{print $2}'`
2100-
if [[ ${gp_cbdb_deploy:0:1} != '#' && $deployment_mode == "'cloud'" ]]; then
2101-
ERROR_EXIT "[FATAL]:gpinitsystem is disabled in cloud mode."
2102-
fi
2103-
fi
2104-
}
2105-
21062096
#******************************************************************************
21072097
# Main Section
21082098
#******************************************************************************
2109-
CHECK_DEPLOYMENT_MODE
21102099
trap 'ERROR_EXIT "[FATAL]:-Received INT or TERM signal"' INT TERM
21112100
while getopts ":vaqe:c:l:-:p:m:h:n:s:P:S:b:DB:I:O:E:F:M:U:T:C" opt
21122101
do

gpMgmt/bin/gpmovemirrors

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) EMC Inc 2010. All Rights Reserved.
66
#
7-
from gppylib.mainUtils import SimpleMainLock, ExceptionNoStackTraceNeeded, check_deployment_mode
7+
from gppylib.mainUtils import SimpleMainLock, ExceptionNoStackTraceNeeded
88

99
import os
1010
import sys
@@ -55,7 +55,6 @@ The input file should be a plain text file with the format:
5555
An input file must be specified.
5656
""",
5757
]
58-
check_deployment_mode('gpmovemirrors')
5958

6059

6160
# ----------------------- Command line option parser ----------------------

gpMgmt/bin/gppylib/mainUtils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,6 @@ def parseStatusLine(line, isStart = False, isStop = False):
466466
reasonStr = ":".join(reasonArr)
467467
return reasonCode, reasonStr, started, dir
468468

469-
def check_deployment_mode(program_name):
470-
deploymentMode = subprocess.check_output("gpconfig -s gp_cbdb_deploy | grep 'Coordinator value'| awk '{print $3}'", shell=True).decode().strip()
471-
if deploymentMode == "cloud":
472-
raise gp.GpError("%s is not supported in cloud deployment mode" % program_name)
473469

474470
def check_fts(fts):
475471
fts_check_cmd= "ps -ef | awk '{print \$2, \$8}' | grep gpfts | grep -v grep"

gpMgmt/bin/gprecoverseg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ if mirroring is configured and operational.
1010
# THIS IMPORT MUST COME FIRST
1111
#
1212
# import mainUtils FIRST to get python version check
13-
from gppylib.mainUtils import simple_main, check_deployment_mode
13+
from gppylib.mainUtils import simple_main
1414
from gppylib.programs.clsRecoverSegment import GpRecoverSegmentProgram
1515

1616
if __name__ == '__main__':
17-
check_deployment_mode('gprecoverseg')
1817
simple_main(GpRecoverSegmentProgram.createParser,
1918
GpRecoverSegmentProgram.createProgram,
2019
GpRecoverSegmentProgram.mainOptions())

gpMgmt/bin/gpstart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,5 +927,4 @@ class GpStart:
927927

928928

929929
if __name__ == '__main__':
930-
check_deployment_mode('gpstart')
931930
simple_main(GpStart.createParser, GpStart.createProgram)

gpMgmt/bin/gpstop

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,4 @@ class GpStop:
978978
is_external_fts=external_fts)
979979

980980
if __name__ == '__main__':
981-
if len(sys.argv) != 2 or sys.argv[1] != "-u":
982-
check_deployment_mode("gpstop")
983981
simple_main(GpStop.createParser, GpStop.createProgram)

gpMgmt/bin/lib/gp_bash_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ BUILD_COORDINATOR_PG_HBA_FILE () {
802802
$ECHO "host replication $USER_NAME $STANDBY_HOSTNAME trust" >> ${GP_DIR}/$PG_HBA
803803
fi
804804
fi
805-
if [ "$CLUSTER_BOOT_MODE" = "PRODUCTION" ];then
805+
if [ "$CLUSTER_BOOT_MODE" = "PRODUCTION" ] && [ $USE_EXTERNAL_FTS -ne 0 ];then
806806
for fts in ${FTS_HOST_MACHINE_LIST[*]}
807807
do
808808
if [ ! "$FTS_HOST" = "$COORDINATOR_HOSTNAME" ];then

src/backend/cdb/cdbutil.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,6 @@ char *gp_etcd_account_id = NULL;
21422142
char *gp_etcd_cluster_id = NULL;
21432143
char *gp_etcd_namespace = NULL;
21442144
char *gp_etcd_endpoints = NULL;
2145-
char *gp_cbdb_deploy = NULL;
21462145

21472146
static etcdlib_endpoint_t etcd_endpoints[GP_ETCD_ENDPOINTS_NUM] = {0};
21482147
static int etcd_endpoints_num = 0;

src/backend/utils/misc/guc_gp.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4726,16 +4726,6 @@ struct config_string ConfigureNamesString_gp[] =
47264726
"localhost:2379",
47274727
NULL, NULL, NULL
47284728
},
4729-
{
4730-
{"gp_cbdb_deploy", PGC_BACKEND, CUSTOM_OPTIONS,
4731-
gettext_noop("CBDB deploy environment setup."),
4732-
gettext_noop("This indicates the cbdb is deployed with onpromise or cloud environment. Default is onpromise"),
4733-
GUC_SUPERUSER_ONLY
4734-
},
4735-
&gp_cbdb_deploy,
4736-
"onpromise",
4737-
NULL, NULL, NULL
4738-
},
47394729
#endif
47404730
#ifdef ENABLE_IC_PROXY
47414731
{

0 commit comments

Comments
 (0)