From 74246baabdea919585fdd6f4d2469e652d99a98d Mon Sep 17 00:00:00 2001 From: gyt0221 <846772234@qq.com> Date: Wed, 30 Dec 2020 17:53:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=A7=E7=89=88=E6=9C=AC=E5=8D=87?= =?UTF-8?q?=E7=BA=A7bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/local/UpgradeUtility.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/script/local/UpgradeUtility.py b/script/local/UpgradeUtility.py index 6614c9e..1db3bfe 100644 --- a/script/local/UpgradeUtility.py +++ b/script/local/UpgradeUtility.py @@ -497,7 +497,16 @@ def syncPostgresqlconf(dbInstance): 'node_group_mode', 'segment_size', 'server_encoding', 'server_version', 'server_version_num', 'sql_compatibility', - 'wal_block_size', 'wal_segment_size'] + 'wal_block_size', 'wal_segment_size', 'enable_beta_nestloop_fusion', + 'enable_upsert_to_merge', 'force_parallel_mode', + 'max_background_workers', 'max_parallel_workers_per_gather', + 'min_parallel_table_scan_size', 'pagewriter_threshold', + 'parallel_leader_participation', 'parallel_setup_cost', + 'parallel_tuple_cost', 'parctl_min_cost', 'tcp_recv_timeout', + 'wal_compression', 'enable_parallel_hash', 'enable_parallel_append', + 'max_parallel_maintenance_workers', 'min_parallel_index_scan_size', + 'sync_config_strategy', 'wal_file_init_num', 'wal_writer_cpu', + 'xlog_flush_uplimit', 'xlog_idle_flushes_before_sleep'] for gucName in internalGucList: if gucName in gucParamDict.keys(): del gucParamDict[gucName] From c170734a997f666ac8071511725a2029e0fede6c Mon Sep 17 00:00:00 2001 From: gyt0221 <846772234@qq.com> Date: Wed, 30 Dec 2020 19:36:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E5=8A=A0=E8=BD=BDclib?= =?UTF-8?q?=EF=BC=8C=E8=A7=84=E9=81=BFgs=5Fcheck=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/gs_check | 10 ++++++++++ script/gs_install | 9 +++++++++ script/gs_postuninstall | 2 +- script/gs_preinstall | 4 ++-- script/gs_ssh | 9 +++++++++ script/gs_sshexkey | 10 ++++++++++ script/gspylib/inspection/common/CheckResult.py | 3 ++- .../gspylib/inspection/items/network/CheckNICModel.py | 4 ++-- simpleInstall/install.sh | 2 +- 9 files changed, 46 insertions(+), 7 deletions(-) diff --git a/script/gs_check b/script/gs_check index 7cac364..05d5625 100644 --- a/script/gs_check +++ b/script/gs_check @@ -29,6 +29,16 @@ import time import pwd import grp import pickle +package_path = os.path.dirname(os.path.realpath(__file__)) +ld_path = package_path + "/gspylib/clib" +if 'LD_LIBRARY_PATH' not in os.environ: + os.environ['LD_LIBRARY_PATH'] = ld_path + os.execve(os.path.realpath(__file__), sys.argv, os.environ) +if not os.environ.get('LD_LIBRARY_PATH').startswith(ld_path): + os.environ['LD_LIBRARY_PATH'] = \ + ld_path + ":" + os.environ['LD_LIBRARY_PATH'] + os.execve(os.path.realpath(__file__), sys.argv, os.environ) + import xml.etree.cElementTree as ETree from itertools import combinations from datetime import datetime, timedelta diff --git a/script/gs_install b/script/gs_install index cd6bfb0..1c60f8b 100644 --- a/script/gs_install +++ b/script/gs_install @@ -21,6 +21,15 @@ import os import sys +package_path = os.path.dirname(os.path.realpath(__file__)) +ld_path = package_path + "/gspylib/clib" +if 'LD_LIBRARY_PATH' not in os.environ: + os.environ['LD_LIBRARY_PATH'] = ld_path + os.execve(os.path.realpath(__file__), sys.argv, os.environ) +if not os.environ.get('LD_LIBRARY_PATH').startswith(ld_path): + os.environ['LD_LIBRARY_PATH'] = \ + ld_path + ":" + os.environ['LD_LIBRARY_PATH'] + os.execve(os.path.realpath(__file__), sys.argv, os.environ) sys.path.append(sys.path[0]) from gspylib.common.GaussLog import GaussLog diff --git a/script/gs_postuninstall b/script/gs_postuninstall index 30f2027..0a1f8d9 100644 --- a/script/gs_postuninstall +++ b/script/gs_postuninstall @@ -31,7 +31,7 @@ ld_path = package_path + "/gspylib/clib" if 'LD_LIBRARY_PATH' not in os.environ: os.environ['LD_LIBRARY_PATH'] = ld_path os.execve(os.path.realpath(__file__), sys.argv, os.environ) -if ld_path not in os.environ.get('LD_LIBRARY_PATH'): +if not os.environ.get('LD_LIBRARY_PATH').startswith(ld_path): os.environ['LD_LIBRARY_PATH'] = \ ld_path + ":" + os.environ['LD_LIBRARY_PATH'] os.execve(os.path.realpath(__file__), sys.argv, os.environ) diff --git a/script/gs_preinstall b/script/gs_preinstall index abc8141..e9e4194 100644 --- a/script/gs_preinstall +++ b/script/gs_preinstall @@ -318,9 +318,9 @@ General options: ld_path = package_path + "/gspylib/clib" rerun = True - if not 'LD_LIBRARY_PATH' in os.environ: + if 'LD_LIBRARY_PATH' not in os.environ: os.environ['LD_LIBRARY_PATH'] = ld_path - elif not ld_path in os.environ.get('LD_LIBRARY_PATH'): + elif not os.environ.get('LD_LIBRARY_PATH').startswith(ld_path): os.environ['LD_LIBRARY_PATH'] = \ ld_path + ":" + os.environ['LD_LIBRARY_PATH'] else: diff --git a/script/gs_ssh b/script/gs_ssh index c50a8f5..bb15220 100644 --- a/script/gs_ssh +++ b/script/gs_ssh @@ -20,6 +20,15 @@ ############################################################################# import os import sys +package_path = os.path.dirname(os.path.realpath(__file__)) +ld_path = package_path + "/gspylib/clib" +if 'LD_LIBRARY_PATH' not in os.environ: + os.environ['LD_LIBRARY_PATH'] = ld_path + os.execve(os.path.realpath(__file__), sys.argv, os.environ) +if not os.environ.get('LD_LIBRARY_PATH').startswith(ld_path): + os.environ['LD_LIBRARY_PATH'] = \ + ld_path + ":" + os.environ['LD_LIBRARY_PATH'] + os.execve(os.path.realpath(__file__), sys.argv, os.environ) from gspylib.common.GaussLog import GaussLog from gspylib.common.Common import DefaultValue diff --git a/script/gs_sshexkey b/script/gs_sshexkey index 14a2e1a..fe3034e 100644 --- a/script/gs_sshexkey +++ b/script/gs_sshexkey @@ -33,6 +33,16 @@ import grp import socket import getpass import shutil +package_path = os.path.dirname(os.path.realpath(__file__)) +ld_path = package_path + "/gspylib/clib" +if 'LD_LIBRARY_PATH' not in os.environ: + os.environ['LD_LIBRARY_PATH'] = ld_path + os.execve(os.path.realpath(__file__), sys.argv, os.environ) +if not os.environ.get('LD_LIBRARY_PATH').startswith(ld_path): + os.environ['LD_LIBRARY_PATH'] = \ + ld_path + ":" + os.environ['LD_LIBRARY_PATH'] + os.execve(os.path.realpath(__file__), sys.argv, os.environ) + from gspylib.common.GaussLog import GaussLog from gspylib.common.ErrorCode import ErrorCode from gspylib.threads.parallelTool import parallelTool diff --git a/script/gspylib/inspection/common/CheckResult.py b/script/gspylib/inspection/common/CheckResult.py index c40d8b9..87281e5 100644 --- a/script/gspylib/inspection/common/CheckResult.py +++ b/script/gspylib/inspection/common/CheckResult.py @@ -236,7 +236,8 @@ class CheckResult(object): for itemResult in self._items: resultDic['name'] = itemResult.name resultDic['category'] = itemResult.category - resultDic['std'] = itemResult.standard.decode('utf-8', 'ignore') + resultDic['std'] = "" if itemResult.standard.strip() == "" \ + else itemResult.standard.decode('utf-8', 'ignore') resultDic['rst'] = itemResult.rst resultDic['analysis'] = itemResult.analysis resultDic['suggestion'] = itemResult.suggestion diff --git a/script/gspylib/inspection/items/network/CheckNICModel.py b/script/gspylib/inspection/items/network/CheckNICModel.py index baf120e..e617128 100644 --- a/script/gspylib/inspection/items/network/CheckNICModel.py +++ b/script/gspylib/inspection/items/network/CheckNICModel.py @@ -66,8 +66,8 @@ class CheckNICModel(BaseItem): cmd = "lspci |grep %s" % PCIAddr (status, output) = subprocess.getstatusoutput(cmd) self.result.raw += "%s\n" % (output) - if (status == 0 and len(output.split(':')) == 3): - modelInfo = output.split(':')[2].split('(')[0] + if status == 0 and len(output.split(':')) >= 3: + modelInfo = ':'.join(output.split(':')[2:]).split('(')[0] self.result.val += "model: %s\n" % (modelInfo.strip()) else: self.result.val += "Failed to get NIC %s model" \ diff --git a/simpleInstall/install.sh b/simpleInstall/install.sh index ebc393f..941e597 100644 --- a/simpleInstall/install.sh +++ b/simpleInstall/install.sh @@ -106,7 +106,7 @@ function fn_get_openGauss_tar() then url="https://opengauss.obs.cn-south-1.myhuaweicloud.com/1.1.0/${system_arch}/openGauss-1.1.0-${system_name}-64bit-all.tar.gz" echo "Downloading openGauss tar from official website at ${install_tar}" - wget $url --timeout=30 --tries=3 && tar -zxvf openGauss-1.1.0-${system_name}-64bit-all.tar.gz + wget $url --timeout=30 --tries=3 && tar -zxf openGauss-1.1.0-${system_name}-64bit-all.tar.gz if [ $? -ne 0 ] then echo "wget error. The $install_tar need openGauss-1.1.0-${system_name}-64bit-om.tar.gz"