Misc bugfixes

This commit is contained in:
dengxuyue 2021-03-06 12:36:55 +08:00
parent 4ecea327e5
commit 3d79c59118
1729 changed files with 44948 additions and 32888 deletions

View File

@ -0,0 +1,301 @@
#!/usr/bin/perl
use warnings;
use strict;
use Getopt::Long;
use File::Basename qw(dirname);
our $show_usage;
our $verbose;
our $ignored_dir;
our $asanlog_dir;
our $output;
use constant {
SEARCH_KEY_LEN => 64,
};
sub usage() {
print "perl asan_report.pl --asanlog-dir /Directory/to/AddressSanitize/Log/ \n";
print "perl asan_report.pl --asanlog-dir /Directory/to/AddressSanitize/Log/ --output /Path/to/Output/File --ignore-dir /Directory/to/Ignored/Results/ \n";
print "perl asan_report.pl --help \n";
}
sub get_asan_log_dir {
my $log_file_dir = $asanlog_dir;
unless ($asanlog_dir) {
my $asan_option = $ENV{'ASAN_OPTIONS'};
if ($asan_option =~ /log_path=([\w\/\.\-\s]+)/) {
$log_file_dir = dirname $1;
}
}
$log_file_dir =~ s/\/+$//g;
$log_file_dir;
}
sub check_component {
my($line_block) = @_;
my $component = '';
for my $line(@$line_block) {
if ($line =~ m/^\s+#(\d+)\s+(\w+)\s+in\s+(\w+)\s+(\S+)$/) {
my($index, $addr, $func, $file_lineno) = ($1, $2, $3, $4);
my ($file, $lno) = split (/:/, $file_lineno);
if ($func eq 'main') {
if ($file =~ m{/Code/src/}) {
my $fn = $';
if ($fn =~ m{^(gtm|cm)/}) {
$component = $1;
}
elsif ($fn =~ m{^backend/}) {
$component = 'gaussdb';
}
elsif ($fn =~ m{^bin/(\w+)/}) {
$component = $1
}
else {
print "Unknown main location: $line\n"
}
return $component if $component;
}
}
else {
# last result will win
if ($file =~ m{/Code/src/}) {
my $fn = $';
if ($fn =~ m{^(gtm|cm)/}) {
$component = $1;
}
elsif ($fn =~ m{^backend/}) {
$component = 'gaussdb';
}
elsif ($fn =~ m{^bin/(\w+)/}) {
$component = $1
}
}
}
}
}
$component = 'unknown' unless $component;
$component;
}
sub is_call_stack_unique {
my ($ignored_call_stacks, $uniq_call_stacks, $line_block) = @_;
my $search_key = '';
my $signature = '';
for my $line(@$line_block) {
if ($line =~ m/^\s+#(\d+)\s+(\w+)\s+in\s+(\w+)\s+(\S+)$/) {
my($index, $addr, $func, $file_lineno) = ($1, $2, $3, $4);
my ($file, $lno) = split (/:/, $file_lineno);
if ($file =~ m{/Code/src/}) {
$file = "src/" . $';
if (defined $lno) {
$search_key = $search_key . "$func:$file:$lno";
}
else {
$search_key = $search_key . "$func:$file";
}
}
if (defined $lno) {
$signature = $signature . "$func:$file:$lno";
}
else {
$signature = $signature . "$func:$file";
}
}
}
if (ref $ignored_call_stacks eq 'HASH') {
if ( exists $ignored_call_stacks->{substr($search_key, 0, SEARCH_KEY_LEN)} ) {
for my $sig(@{ $ignored_call_stacks->{substr($search_key, 0, SEARCH_KEY_LEN)} } ) {
return 0 if ($sig eq $signature);
}
}
}
if ( exists $uniq_call_stacks->{substr($search_key, 0, SEARCH_KEY_LEN)} ) {
for my $sig(@{ $uniq_call_stacks->{substr($search_key, 0, SEARCH_KEY_LEN)} } ) {
return 0 if ($sig eq $signature);
}
}
else {
$uniq_call_stacks->{substr($search_key, 0, SEARCH_KEY_LEN)} = []
}
push @{$uniq_call_stacks->{substr($search_key, 0, SEARCH_KEY_LEN)}}, $signature;
return 1;
}
sub gen_report {
my ($log_dir, $ignored_call_stacks, $output_file) = @_;
return {} unless $log_dir;
my %uniq_call_stacks;
my @mem_leak_block = ();
my @addr_issue_block = ();
for my $file(glob "${log_dir}/*") {
open my $fh, "<$file" or next;
my $type = 'none';
my @file_content = ();
while(<$fh>) {
push @file_content, $_;
}
close $fh;
my $component = check_component(\@file_content);
if ($output_file) {
}
foreach my $line(@file_content) {
chomp $line;
next unless $line =~ /\s*\S+/;
# headline
# assuming one type error
if ($line =~ /^==\d+==ERROR:/) {
if ($line =~ /LeakSanitizer:/) {
$type = 'memory-leak';
}
elsif ($line =~ /AddressSanitizer:/ && $line =~ /double-free/) {
$type = 'double-free';
}
elsif ($line =~ /AddressSanitizer:/ && $line =~ /attempting free/) {
$type = 'bad-free';
}
elsif ($line =~ /AddressSanitizer:\s+([-\w]+)/) {
$type = $1;
}
else {
print "Unknown error type in $file:\n$line\n" if $verbose;
}
}
# block header
elsif ($line =~ /(Direct|Indirect) leak/) {
$type = 'memory-leak' if $type eq 'none';
if (scalar @mem_leak_block) {
if (is_call_stack_unique($ignored_call_stacks, \%uniq_call_stacks, \@mem_leak_block)) {
if ($output_file) {
open MEMLEAK, ">>$output_file.memory-leak.$component";
print MEMLEAK "$_\n" foreach (@mem_leak_block);
print MEMLEAK "\n\n";
close MEMLEAK;
}
}
@mem_leak_block = ();
}
# $type = 'memory-leak';
push @mem_leak_block, $line;
}
elsif ($line =~ /^\s+#\d+/) {
if ($type eq 'memory-leak') {
push @mem_leak_block, $line
}
elsif ($type eq 'none') {
print "Unknown issue type for $file\n" if $verbose;
}
else {
push @addr_issue_block, $line
}
}
# start another block
elsif ( $line =~ /^\w+/ || $line =~ /^={3,}/ ) {
if ($type eq 'memory-leak' && scalar @mem_leak_block) {
if (is_call_stack_unique($ignored_call_stacks, \%uniq_call_stacks, \@mem_leak_block)) {
if ($output_file) {
open MEMLEAK, ">>$output_file.memory-leak.$component";
print MEMLEAK "$_\n" foreach (@mem_leak_block);
print MEMLEAK "\n\n";
close MEMLEAK;
}
}
@mem_leak_block = ();
}
elsif ($type eq 'none' && (scalar @addr_issue_block || scalar @mem_leak_block)) {
print "\n\n***FATAL***: you should not see me at all.\n";
print "Check in $file:\n$line\n";
}
elsif (scalar @addr_issue_block) {
# Fatal address issue:
# 1. stack-buffer-overflow/heap-buffer-overflow
# 2. double-free
#
# Assuming only ONE issue in each log file for above issue type
last
}
else {
# first block for fatal address issue is not yet filled
# second or subsequent blocks for memory leak
}
}
}
close $fh;
if ($type eq 'memory-leak' && scalar @mem_leak_block) {
if (is_call_stack_unique($ignored_call_stacks, \%uniq_call_stacks, \@mem_leak_block)) {
if ($output_file) {
open MEMLEAK, ">>$output_file.memory-leak.$component";
print MEMLEAK "$_\n" foreach (@mem_leak_block);
print MEMLEAK "\n\n";
close MEMLEAK;
}
}
}
elsif ($type ne 'none' && scalar @addr_issue_block) {
if (is_call_stack_unique($ignored_call_stacks, \%uniq_call_stacks, \@addr_issue_block)) {
open my $ifh, "<$file" or next;
open my $ofh, ">>$output.$type.$component" or next;
while (<$ifh>) {
print $ofh $_;
}
print $ofh "\n\n";
close $ifh;
close $ofh;
}
}
@mem_leak_block = ();
@addr_issue_block = ()
}
## for my $file(glob "${log_file_trunk}*") {
close MEMLEAK;
\%uniq_call_stacks
}
GetOptions (
"ignore-dir=s" => \$ignored_dir,
"asanlog-dir=s" => \$asanlog_dir,
"output|o=s" => \$output,
"verbose" => \$verbose,
"help|h" => \$show_usage
) or die("Error in command line arguments\n");
if ($show_usage) {
usage();
exit 0;
}
$output = "$$" unless $output;
my $ignored_call_stacks = gen_report($ignored_dir, undef, undef);
my $log_file_dir = get_asan_log_dir();
gen_report($log_file_dir, $ignored_call_stacks, $output);

View File

@ -0,0 +1,3 @@
#----pg_regress
leak:regression_main
leak:get_node_info_name

View File

@ -0,0 +1,520 @@
#!/bin/bash
# ***********************************************************************
# Copyright: (c) Huawei Technologies Co., Ltd. 2019. All rights reserved.
# script for memcheck setup
# version: 1.0.0
# change log:
# ***********************************************************************
set -e
SUFFIX="$(date +%Y-%m-%d-%H-%M-%S | tr -d '\n\r')"
CWD="$(pwd | tr -d '\n\r')"
alter_env_file=""
env_file="$HOME/.bashrc"
os_ver="Suse11SP1"
user="$(whoami | tr -d '\r\n')"
# commence/restore
action="commence"
# jeprof/asan
mode="asan"
version="V100R008C10"
revision=""
jeprofpath=""
mem_check_dir="$(dirname $0)"
TOP_DIR="$(cd $mem_check_dir/../../; pwd)"
INST_DIR=$TOP_DIR/mppdb_temp_install
if [ ! -z $GAUSSHOME ]; then
INST_DIR=$GAUSSHOME
fi
PORT=22200
if [ ! -z $LLTPORT ]; then
PORT=$LLTPORT
fi
gcc_version="5.4"
help()
{
echo "$0 [-t action|-m mode|-u user|-f user-profile|-v version|-r revision|-p jeprof] [/path/to/gaussdb/package]"
echo " "
echo " -t action setup or restore memory check and start cluster for you"
echo " action can be:"
echo " commence set up memory check tools and start cluster, and then you can run jobs"
echo " restore restore cluster to the state before you set up mem check tools"
echo " llt-mem-check 1) run <Gauss200-repo-top-dir>/Code/configure with '--enable-memory-check'"
echo " 2) make && make install"
echo " 3) make fastcheck"
echo " gen-report generate report for memory check of mode 'asan' or 'jeprof'"
echo " -m mode what kind of mem check you will do"
echo " mode can be:"
echo " jeprof enaable jemallc profiling and start cluster, and then you can run jobs"
echo " asan enaable address sanitizer and start cluster"
echo " -u user current user name"
echo " -v version current mppdb version, e.g. V100R007C10"
echo " -r revision current mppdb revision, e.g. a4a4edc7"
echo " -f user-profile alternative user profile, e.g. /opt/huawei/Bigdata/mppdb/.mppdb_profile"
echo " -p jeprof jeprof file path"
echo " "
echo "Example:"
echo " "
}
# environ variables
setup_environ()
{
# SUSE
if [ $(cat /etc/issue | grep 'SUSE' | wc -l) -ge 1 ]; then
export SUSE11_HOME="$(cd ../buildtools/suse11_sp1_x86_64/; pwd)"
export CC=$SUSE11_HOME/gcc$gcc_version/gcc/bin/gcc
export CXX=$SUSE11_HOME/gcc$gcc_version/gcc/bin/g++
export JAVA_HOME=$SUSE11_HOME/jdk8/jdk1.8.0_77
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
LD_LIBRARY_PATH=$JRE_HOME/lib/amd64/server:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$SUSE11_HOME/gcc$gcc_version/gcc/lib64:$SUSE11_HOME/gcc$gcc_version/isl/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$SUSE11_HOME/gcc$gcc_version/mpc/lib:$SUSE11_HOME/gcc$gcc_version/mpfr/lib/:$SUSE11_HOME/gcc$gcc_version/gmp/lib:$LD_LIBRARY_PATH
export PATH=$SUSE11_HOME/gcc$gcc_version/gcc/bin:$PATH
# Redhat
elif [ $(cat /etc/issue | grep 'Red Hat'|wc -l) -ge 1 ]; then
export RHEL64_HOME=$(cd ../buildtools/redhat6.4_x86_64/; pwd)
export CC=$RHEL64_HOME/gcc$gcc_version/gcc/bin/gcc
export CXX=$RHEL64_HOME/gcc$gcc_version/gcc/bin/g++
export JAVA_HOME=$RHEL64_HOME/jdk8/jdk1.8.0_77
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
LD_LIBRARY_PATH=$JRE_HOME/lib/amd64/server:$LD_LIBRARY_PATH
LD_LIBRARY_PATH=$RHEL64_HOME/gcc$gcc_version/gcc/lib64:$RHEL64_HOME/gcc$gcc_version/isl/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$RHEL64_HOME/gcc$gcc_version/mpc/lib:$RHEL64_HOME/gcc$gcc_version/mpfr/lib/:$RHEL64_HOME/gcc$gcc_version/gmp/lib:$LD_LIBRARY_PATH
export PATH=$RHEL64_HOME/gcc$gcc_version/gcc/bin:$PATH
fi
# to suppress some address-sanitizer false negative errors
ulimit -v unlimited
}
check_cluster()
{
i=0
while [ 1 ]; do
sta=''
cm_ctl query | grep 'cluster_state' | grep 'Normal' > /dev/null 2>&1
if [ $? -eq 0 ]; then
sta="Y$sta"
fi
cm_ctl query | grep 'balanced' | grep 'Yes' > /dev/null 2>&1
if [ $? -eq 0 ]; then
sta="Y$sta"
else
#cluster_state: Normal
if [ ! -z $sta ] && [ $sta = "Y" ]; then
cm_ctl switchover -a
fi
fi
chk_code='passed'
if [ -z "$sta" ] || [ "$sta" != "YY" ]; then
chk_code='failed'
else
break
fi
# wait for 5 minutes if 'failed'
if [ $i -gt 30 ]; then
echo "####### $(date): Cluster Status = $chk_code; waiting ... #######"
sleep 10
else
break
fi
i=$(expr $i + 1)
done
echo "####### $(date): Cluster Status = $chk_code ########"
}
get_package()
{
if [ -z $version ]; then
echo "No db version is provided."
elif [ $version = "V100R007C00" ]; then
ftpurl="ftp://mpp:mpp@10.180.56.168:16162/V1R7TrunkC00_packges/${os_ver}"
elif [ $version = "V100R007C10" ]; then
ftpurl="ftp://mpp:mpp@10.180.56.168:16162/V1R7TrunkC10_packges/${os_ver}"
elif [ $version = "V100R008C00" ]; then
ftpurl="ftp://mpp:mpp@10.180.56.168:16162/V1R8TrunkC00_packges/${os_ver}"
else
echo "Current version $version is not supported yet."
exit 1
fi
echo "ftp: $ftpurl"
latest_pkg=""
ftp $ftpurl/ <<_EOF1_ > $CWD/package.list.$$
ls -lrt
_EOF1_
if [ -z $revision ]; then
# get latest package, e.g. "Gauss-MPPDB-ALL-PACKAGES-20161221175107-SVN7610"
latest_pkg=$(cat $CWD/package.list.$$ | grep 'Gauss-MPPDB-ALL-PACKAGES' | tail -n 1 | awk '{print $NF}')
else
# get chosen package, e.g. "Gauss-MPPDB-ALL-PACKAGES-20161221175107-SVN7610"
latest_pkg=$(cat $CWD/package.list.$$ | grep "$revision" | awk '{print $NF}')
fi
rm -f $CWD/package.list.$$
if [ -z "$latest_pkg" ]; then
echo "Cannot find proper package."
exit 1
fi
revision1=$(echo $latest_pkg | awk 'BEGIN{FS="-"}{print $7}')
if [ ! -z $revision ] && [ $revision != $revision1 ]; then
echo "Cannot get proper version $revision($revision1)"
exit 1
fi
revision=$revision1
echo $revision
test -d $HOME/memchk/$revision || mkdir $HOME/memchk/$revision
cd $HOME/memchk/$revision
for t in debug memcheck; do
test -d $t || mkdir $t
cd $t
echo "ftpurl: $ftpurl/$latest_pkg/$t/"
ftp $ftpurl/$latest_pkg/$t/ <<_EOF2_
get Gauss200_OLAP_${version}_PACKAGES.tar.gz
_EOF2_
echo "Got $latest_pkg."
tar -xzf Gauss200_OLAP_${version}_PACKAGES.tar.gz
tar -xzvf Gauss200-OLAP-${version}*-64bit.tar.gz
mkdir gaussdb/
cd gaussdb
../Gauss200-OLAP-${version}*-64bit.bin
cd ../..
done
# debug version is also downloaded and extracted
inst_pkg_dir=$HOME/memchk/$revision/memcheck/gaussdb
cd $CWD
}
backup_binaries()
{
for d in bin lib; do
if [ ! -d $GAUSSHOME/$d.orig ]; then
mkdir $GAUSSHOME/$d.orig
echo "cp -fr $GAUSSHOME/$d/* $GAUSSHOME/$d.orig"
cp -fr $GAUSSHOME/$d/* $GAUSSHOME/$d.orig
else
mkdir $GAUSSHOME/$d.$SUFFIX
echo "cp -fr $GAUSSHOME/$d/* $GAUSSHOME/$d.$SUFFIX"
cp -fr $GAUSSHOME/$d/* $GAUSSHOME/$d.$SUFFIX
fi
done
}
replace_binaries()
{
echo "cp -f $inst_pkg_dir/bin/gaussdb $GAUSSHOME/bin/gaussdb"
cp -f $inst_pkg_dir/bin/gaussdb $GAUSSHOME/bin/gaussdb
}
restore_binaries()
{
echo "cp -f $GAUSSHOME/bin.orig/gaussdb $GAUSSHOME/bin/gaussdb"
cp -f $GAUSSHOME/bin.orig/gaussdb $GAUSSHOME/bin/gaussdb
}
restart_om_monitor()
{
ps -ef | grep -w 'om_monitor' | grep -w $user | grep -v grep
ps -ef | grep -w 'om_monitor' | grep -w $user | grep -v grep | awk '{print "kill -9", $2}' | bash
ps -ef | grep -w 'cm_agent' | grep -w $user | grep -v grep
ps -ef | grep -w 'cm_agent' | grep -w $user | grep -v grep | awk '{print "kill -9", $2}' | bash
}
setup_jeprof()
{
cm_ctl stop -mi
backup_binaries
replace_binaries
echo "Fixing $env_file..."
cp $env_file $env_file.$SUFFIX
awk '!/export MALLOC_CONF/{print $0} /export MALLOC_CONF/{}' $env_file.$SUFFIX > $env_file
echo "export MALLOC_CONF='prof:true,prof_final:false,prof_gdump:true,lg_prof_sample:20'" >> $env_file
if [ ! -z $alter_env_file ]; then
echo "Fixing $alter_env_file..."
cp $alter_env_file $alter_env_file.$SUFFIX
awk '!/export MALLOC_CONF/{print $0} /export MALLOC_CONF/{}' $alter_env_file.$SUFFIX > $alter_env_file
echo "export MALLOC_CONF='prof:true,prof_final:false,prof_gdump:true,lg_prof_sample:20'" >> $alter_env_file
fi
restart_om_monitor
cm_ctl start
check_cluster
}
setup_asan()
{
cm_ctl stop -mi
backup_binaries
replace_binaries
test -d $HOME/memchk/asan || mkdir -p $HOME/memchk/asan
echo "Fixing $env_file..."
cp $env_file $env_file.$SUFFIX
awk '!/export [AL]SAN_OPTIONS/{print $0} /export [AL]SAN_OPTIONS/{}' $env_file.$SUFFIX > $env_file
echo "export ASAN_OPTIONS='detect_leaks=1:halt_on_error=0:alloc_dealloc_mismatch=0:log_path=$HOME/memchk/asan/runlog'" >> $env_file
if [ -f $HOME/.memleak_ignore ]; then
lopt="suppressions=$TOP_DIR/Tools/memory_check/memleak_ignore"
fi
echo "export LSAN_OPTIONS='exitcode=0:$lopt'" >> $env_file
if [ ! -z $alter_env_file ]; then
echo "Fixing $alter_env_file..."
cp $alter_env_file $alter_env_file.$SUFFIX
awk '!/export [AL]SAN_OPTIONS/{print $0} /export [AL]SAN_OPTIONS/{}' $alter_env_file.$SUFFIX > $alter_env_file
echo "export ASAN_OPTIONS='detect_leaks=1:halt_on_error=0:alloc_dealloc_mismatch=0:log_path=$HOME/memchk/asan/runlog'" >> $alter_env_file
lopt=""
if [ -f $TOP_DIR/Tools/memory_check/memleak_ignore ]; then
lopt="suppressions=$TOP_DIR/Tools/memory_check/memleak_ignore"
fi
echo "export LSAN_OPTIONS='exitcode=0:$lopt'" >> $alter_env_file
fi
restart_om_monitor
cm_ctl start
check_cluster
}
restore_jeprof()
{
cm_ctl stop -mi
restore_binaries
cp $env_file $env_file.$SUFFIX
awk '!/export MALLOC_CONF/{print $0} /export MALLOC_CONF/{}' $env_file.$SUFFIX > $env_file
if [ ! -z $alter_env_file ]; then
cp $alter_env_file $alter_env_file.$SUFFIX
awk '!/export MALLOC_CONF/{print $0} /export MALLOC_CONF/{}' $alter_env_file.$SUFFIX > $alter_env_file
fi
restart_om_monitor
cm_ctl start
check_cluster
}
genreport_jeprof()
{
if [ -z $jeprofpath ]; then
echo "You need provide jeprof file path by '-p'."
help
exit 1
fi
jeprofdir=$(dirname $jeprofpath)
jeproffile=$(basename $jeprofpath)
if [ ${jeproffile: -5} = ".heap" ]; then
jeproffile=${jeproffile%.heap}
fi
mkdir jeprof-report-$SUFFIX
for f in $(ls $jeprofdir/${jeproffile}*.heap); do
fn=$(basename $f)
pprof --show_bytes --pdf $GAUSSHOME/bin/gaussdb $f > jeprof-report-$SUFFIX/$fn.pdf
done
}
restore_asan()
{
cm_ctl stop -mi
restore_binaries
cp $env_file $env_file.$SUFFIX
awk '!/export ASAN_OPTIONS/{print $0} /export ASAN_OPTIONS/{print ""}' $env_file.$SUFFIX > $env_file
if [ ! -z $alter_env_file ]; then
cp $alter_env_file $alter_env_file.$SUFFIX
awk '!/export ASAN_OPTIONS/{print $0} /export ASAN_OPTIONS/{print ""}' $alter_env_file.$SUFFIX > $alter_env_file
fi
restart_om_monitor
cm_ctl start
check_cluster
}
genreport_asan()
{
out_file="$TOP_DIR/Tools/memory_check/$(date +%Y-%m-%d-%H-%M-%S)"
perl $TOP_DIR/Tools/memory_check/asan_report.pl --asanlog-dir $HOME/memchk/asan --output $out_file
echo "Please check:"
echo "$(ls ${out_file}*)"
}
while getopts f:m:p:r:t:u:v:h option
do
case "${option}" in
f)
alter_env_file=${OPTARG}
;;
m)
mode=${OPTARG}
;;
p)
jeprofpath=${OPTARG}
;;
r)
revision=${OPTARG}
;;
t)
action=${OPTARG}
;;
u)
user=${OPTARG}
;;
v)
version=${OPTARG}
;;
h)
help
exit 0
;;
-)
case "${OPTARG}" in
gcc)
val="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
gcc_version=$val
;;
gcc=*)
val=${OPTARG#*=}
opt=${OPTARG%=$val}
gcc_version=$val
;;
*)
echo "Unknown option --${OPTARG}"
;;
esac
;;
*)
echo "The option can only be '-f', '-t', '-u', '-f', or '-h'."
echo " "
help
exit 1
;;
esac
done
if [ ${gcc_version:0:3} == "5.4" ];then
gcc_version="5.4"
elif [ ${gcc_version:0:3} == "6.1" ];then
gcc_version="6.1"
else
echo "Unknown gcc version $gcc_version"
exit 0
fi
if [ $mode != "asan" ] && [ $mode != "jeprof" ]; then
echo "ERROR: mode ($mode) is not supported."
echo " "
help
exit 1
fi
if [ $action != "commence" ] && [ $action != "restore" ] && [ $action != "gen-report" ] && [ $action != "llt-mem-check" ]; then
echo "ERROR: action ($action) is not supported."
echo " "
help
exit 1
fi
shift $((OPTIND -1))
inst_pkg_dir=$1
if [ $action = "commence" ]; then
# -- get package if necessary
if [ -z $inst_pkg_dir ]; then
get_package
# inst_pkg_dir is setup in above get_package function, if everything works well
fi
if [ -z $inst_pkg_dir ]; then
echo "Cannot get proper package for memory check."
exit 0
fi
if [ $mode = "asan" ]; then
setup_asan
elif [ $mode = "jeprof" ]; then
setup_jeprof
fi
elif [ $action = "restore" ]; then
if [ $mode = "asan" ]; then
restore_asan
elif [ $mode = "jeprof" ]; then
restore_jeprof
fi
elif [ $action = "llt-mem-check" ]; then
cd $TOP_DIR/Code/
setup_environ
make distclean -sj
./configure --gcc-version=${gcc_version}.0 --prefix="${INST_DIR}" CFLAGS='-O0 -g' --enable-debug --enable-cassert --enable-thread-safety --without-readline --without-zlib --enable-memory-check CC=g++
make -sj > /dev/null || make -sj > /dev/null
make fastcheck p=$PORT -sj
elif [ $action = "gen-report" ]; then
if [ $mode = "jeprof" ]; then
genreport_jeprof
elif [ $mode = "asan" ]; then
genreport_asan
fi
fi

0
build/script/build_opengauss.sh Normal file → Executable file
View File

View File

@ -44,17 +44,27 @@ function doing()
#------------------------------
# gsql things
#------------------------------
function cofig_gsql()
function cofig_gsql_and_gs_ktool()
{
doing 'Configuring LD_LIBRARY_PATH and PATH for gsql...'
doing 'Configuring LD_LIBRARY_PATH, PATH and GS_KTOOL_FILE_PATH for gsql and gs_ktool...'
LIB_PATH="${LOCAL_PATH}/lib"
BIN_PATH="${LOCAL_PATH}/bin"
GS_KT_FILE_PATH="${LOCAL_PATH}/gs_ktool_file"
if [ ! -f "${LOCAL_PATH}/bin/gsql" ]; then
logerr "failed to locate ./bin/gsql, please source this file at the path where it is. "
return 1;
fi;
if [ ! -f "${LOCAL_PATH}/bin/gs_ktool" ]; then
logerr "failed to locate ./bin/gs_ktool, please source this file at the path where it is. "
return 1;
fi;
if [ ! -f "${LOCAL_PATH}/gs_ktool_file/gs_ktool_conf.ini" ]; then
logerr "failed to locate ./gs_ktool_file/gs_ktool_con.ini, please source this file at the path where it is. "
return 1;
fi;
export LD_LIBRARY_PATH=${LIB_PATH}:${LD_LIBRARY_PATH}
export PATH=${BIN_PATH}:${PATH}
export GS_KTOOL_FILE_PATH=${GS_KT_FILE_PATH}
echo 'done'
return 0
}
@ -63,7 +73,7 @@ if [ ! -z "$1" ]; then
echo "Usage:"
echo " source $0"
else
cofig_gsql
cofig_gsql_and_gs_ktool
if [ 0 -eq $? ]; then
echo 'All things done.'
fi

View File

@ -1,3 +1,12 @@
rem #######################################################################
rem Copyright (c): 2020-2025, Huawei Tech. Co., Ltd.
rem descript: Compile windows ODBC
rem Return 0 means OK.
rem Return error-code means failed.
rem version: 1.0
rem date: 2020-12-29
rem #######################################################################
@echo off
rem Make sure current dir is .\Build\Script
@ -18,9 +27,8 @@ set ODBC_TMP_DIR=%ROOT_DIR%odbc_tmp
set FULLBRANCH=%1
if "%FULLBRANCH%" == "" (
echo FULLBRANCH is null
set ERRORNO=%ERROR_FULLBRANCH_NULL%
goto END
echo FULLBRANCH is null
set ERRORNO=%ERROR_FULLBRANCH_NULL% && goto END
)
set TAR_FILE=%ROOT_DIR%%FULLBRANCH%-Windows-Odbc.zip
@ -54,8 +62,7 @@ if exist C:\"Program Files (x86)"\WinRAR (
set winrar=C:\"Program Files"\WinRAR\winrar
) else (
echo WinRAR was nowhere to be found in C:\"Program Files (x86)"\WinRAR or C:\"Program Files"\WinRAR
set ERRORNO=%ERROR_WINRAR_NOTEXIST%
goto END
set ERRORNO=%ERROR_WINRAR_NOTEXIST% && goto END
)
cd %ODBC_TMP_DIR%

File diff suppressed because it is too large Load Diff

74
build/script/mpp_package.sh Normal file → Executable file
View File

@ -109,7 +109,7 @@ function print_help()
-V|--version show version information.
-f|--file provide the file list released.
-3rd|--binarylib_dir the directory of third party binarylibs.
-pkg|--package provode type of installation packages, values parameter is all, server, jdbc, odbc, agent, adaptor.
-pkg|--package provode type of installation packages, values parameter is all, server, jdbc, odbc, agent.
-pm product mode, values parameter is single, multiple or opengauss, default value is multiple.
-p|--path generation package storage path.
-t packaging format, values parameter is tar or rpm, the default value is tar.
@ -322,7 +322,6 @@ declare version_string="${mppdb_name_for_package}-${version_number}"
declare package_pre_name="${version_string}-${dist_version}-${PLATFORM}bit"
declare server_package_name="${package_pre_name}.${install_package_format}.gz"
declare agent_package_name="${package_pre_name}-AGENT.${install_package_format}.gz"
declare adaptor_package_name="${package_pre_name}-ADAPTOR.${install_package_format}.gz"
declare gsql_package_name="${mppdb_name_for_package}-${version_number}-${dist_version}-${PLATFORM}bit-gsql.${install_package_format}.gz"
declare client_package_name="${package_pre_name}-ClientTools.${install_package_format}.gz"
declare libpq_package_name="${package_pre_name}-Libpq.${install_package_format}.gz"
@ -355,7 +354,11 @@ else
BINARYLIBS_PATH="${ROOT_DIR}/binarylibs"
fi
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/distribute/include/catalog/upgrade_sql"
if [ "$product_mode"x == "single"x ] || [ "$product_mode"x == "opengauss"x ]; then
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
else
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/distribute/include/catalog/upgrade_sql"
fi
gaussdb_200_file="${binarylib_dir}/buildtools/license_control/gaussdb.version.GaussDB200"
gaussdb_300_file="${binarylib_dir}/buildtools/license_control/gaussdb.version.GaussDB300"
@ -432,7 +435,7 @@ function mpp_pkg_pre_check()
rm -rf $LOG_FILE
fi
if [ X"$package_type" == X"server" -o X"$package_type" == X"all" ] && [ X$zip_package = X"on" ] && [ ! -d "${ROOT_DIR}"/script/script/gspylib/ ]; then
if [ X"$package_type" == X"server" -o X"$package_type" == X"all" ] && [ X"$zip_package" = X"on" ] && [ ! -d "${ROOT_DIR}"/script/script/gspylib/ ]; then
printf "\033[31mCan not found OM script directory. solution steps:\n\033[0m"
echo " 1) git clone git@isource-dg.huawei.com:2222/GaussDB_Kernel/GaussDB_Kernel_OM.git -b $(git branch | grep '*' | sed -e 's/*//g' -e 's/^ //g')"
echo " 2) if you do not have the permission to git it, please call CMO "
@ -452,16 +455,9 @@ function package_upgrade_sql()
echo "Begin to install upgrade_sql files..."
UPGRADE_SQL_TAR="upgrade_sql.tar.gz"
UPGRADE_SQL_SHA256="upgrade_sql.sha256"
SINGLE_IGNORE_VERSION=(263 264 270 280 287)
MULTIP_IGNORE_VERSION=(289 294 296)
cp -r "${UPGRADE_SQL_DIR}" .
[ $? -ne 0 ] && die "Failed to cp upgrade_sql files"
if [ "$product_mode"x == "single"x ] || [ "$product_mode"x == "opengauss"x ]; then
for version_num in ${SINGLE_IGNORE_VERSION[*]}
do
find ./upgrade_sql -name *${version_num}* | xargs rm -rf
done
fi
if [ "$product_mode"x == "multiple"x ]; then
for version_num in ${MULTIP_IGNORE_VERSION[*]}
do
@ -787,7 +783,7 @@ function install_gaussdb()
spec="opengauss"
fi
if [ $spec = "gaussdbkernel" ]; then
if [ "${spec}" = "gaussdbkernel" ]; then
echo "Begin make install Roach..." >> "$LOG_FILE" 2>&1
#copy gs_roach form clienttools to bin
if [ "$version_mode"x == "release"x ]; then
@ -890,7 +886,7 @@ function install_gaussdb()
#back to separate_debug_symbol.sh dir
cd $SCRIPT_DIR
if [ "$version_mode" = "release" -a "$separate_symbol" = "on" -a $zip_package = "on" ]; then
if [ "$version_mode" = "release" -a "$separate_symbol" = "on" -a "$zip_package" = "on" ]; then
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
@ -901,7 +897,7 @@ function install_gaussdb()
cd $ROOT_DIR
# om scripts may be package alone
if [ $zip_package = "on" ]; then
if [ "${zip_package}" = "on" ]; then
copy_script_file "$script_dir/" ${BUILD_DIR}/bin/
cp ${BUILD_DIR}/bin/script/gspylib/etc/sql/pmk_schema.sql ${BUILD_DIR}/share/postgresql/
if [ -f "${BUILD_DIR}"/bin/script/gspylib/etc/sql/pmk_schema_single_inst.sql ]; then
@ -970,6 +966,7 @@ function make_package_gsql()
mkdir -p gsql
mkdir -p gsql/bin
mkdir -p gsql/lib
mkdir -p gsql/gs_ktool_file
# copy gsql and depend *.so
cp ${BUILD_DIR}/bin/gsql gsql/bin
@ -977,6 +974,16 @@ function make_package_gsql()
die "copy gsql failed."
fi
cp ${BUILD_DIR}/bin/gs_ktool gsql/bin
if [ $? -ne 0 ]; then
die "copy gsql failed."
fi
cp -r ${BUILD_DIR}/etc/gs_ktool_file/gs_ktool_conf.ini gsql/gs_ktool_file
if [ $? -ne 0 ]; then
die "copy gs_ktool_con.ini failed."
fi
cd gsql
tar -xvf ${package_path}/${libpq_package_name}
if [ $? -ne 0 ]; then
@ -1161,10 +1168,6 @@ function target_file_copy()
cp -rf $BUILD_DIR/script/impl/ $2/bin/script/
cp -rf $BUILD_DIR/script/local/ $2/bin/script/
# copy server.key to bin path
cp -f ${BUILD_DIR}/server.key.cipher $2/bin/
cp -f ${BUILD_DIR}/server.key.rand $2/bin/
# copy script which gs_roach depends from ${script_dir}/ to $2/bin/script
cp -rf ${script_dir}/other/roach/util/ $2/bin/script/
cp -f ${script_dir}/other/roach/local/* $2/bin/script/local/
@ -1228,10 +1231,6 @@ function target_file_copy()
cp -rf $BUILD_DIR/script/impl/ $2/script/
cp -rf $BUILD_DIR/script/local/ $2/script/
# copy server.key to temp path
cp -f ${BUILD_DIR}/server.key.cipher $2/
cp -f ${BUILD_DIR}/server.key.rand $2/
# copy GaussRoach.py to script dir
cp -f ${script_dir}/other/roach/GaussRoach.py $2/script/
cp -f ${script_dir}/other/roach/SyncDataToStby.py $2/script/
@ -1257,12 +1256,6 @@ function target_file_copy()
if [ $? -ne 0 ]; then
die "copy ${script_dir}/agent/common/py_pstree.py to $2/script/ failed. $res"
fi
#copy adaptor tool to temp path
res=$(cp -rf ${script_dir}/adaptor/ $2/ 2>&1)
if [ $? -ne 0 ]; then
die "copy ${script_dir}/adaptor to $2 failed. $res"
fi
# copy the default xml to temp path
res=$(cp -f ${script_dir}/build/cluster_default_agent.xml $2/ 2>&1)
if [ $? -ne 0 ]; then
@ -1310,7 +1303,7 @@ function read_script_file()
}
#######################################################################
##function make_package have tree actions
##function make_package have three actions
##1.parse release_file_list variable represent file
##2.copy target file into a newly created temporary directory temp
##3.package all file in the temp directory and renome to destination package_path
@ -1520,6 +1513,16 @@ function make_package()
cp ./lib/_cffi_backend.so_UCS4 ./lib/_cffi_backend.so
cp -r ./script/gspylib/pssh/bin ./agent/
cp -r ./script/gspylib/clib ./agent/
if [ "$product_mode"x == "single"x ]
then
if [ ! -e ./agent/centralized_cluster ]
then
touch ./agent/centralized_cluster
echo "This file is used only to distinguish cluster types (generated by the packaging script)." >> ./agent/centralized_cluster
else
echo "This file is used only to distinguish cluster types (generated by the packaging script)." > ./agent/centralized_cluster
fi
fi
$package_command "${agent_package_name}" ./agent ./lib ./cluster_default_agent.xml ./version.cfg >>"$LOG_FILE" 2>&1
if [ $? -ne 0 ]; then
die "$package_command ${agent_package_name} failed"
@ -1527,17 +1530,9 @@ function make_package()
mv ${agent_package_name} ${package_path}
echo "Agent package has been finished."
#compress the adaptor package
echo "Adaptor package is starting."
echo "$package_command ${adaptor_package_name}"
$package_command "${adaptor_package_name}" ./adaptor >>"$LOG_FILE" 2>&1
mv ${adaptor_package_name} ${package_path}
echo "Adaptor package has been finished."
#remove the agent and adaptor path which only needed by agent and adaptor before compress server package
#remove the agent path which only needed by agent before compress server package
echo "Server package is starting."
rm -rf ./agent
rm -rf ./adaptor
cp -a ${BUILD_TOOLS_PATH}/secbox .
if [ -e secbox/libso ] ; then rm -rf secbox/libso ; fi
mkdir -p secbox/libso/
@ -1594,9 +1589,6 @@ function copy_script_file()
local target_dir=$2
cp -rf $target_file/script/ $target_dir/ &&
cp -f ${binarylib_dir}/buildtools/server_key/server.key.cipher $target_dir &&
cp -f ${binarylib_dir}/buildtools/server_key/server.key.rand $target_dir &&
find $target_dir/script/ -type f -print0 | xargs -0 -n 10 -r dos2unix > /dev/null 2>&1 &&
find $target_dir/script/gspylib/inspection/ -name d2utmp* -print0 | xargs -0 rm -rf &&
cp -rf $target_file/script/gspylib/inspection/lib/checknetspeed/speed_test* $target_dir/script/gspylib/inspection/lib/checknetspeed/ &&

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +1,50 @@
[server]
./bin/gs_log
./bin/gsql
./bin/gaussdb
./bin/gaussdb.version.GaussDB200
./bin/gaussdb.version.GaussDB300
./bin/gaussdb.license.GaussDB200_Standard
./bin/gaussmaster
./bin/gstrace
./bin/gs_basebackup
./bin/gs_probackup
./bin/gs_tar
./bin/gs_encrypt
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_initdb
./bin/gs_ctl
./bin/gs_initdb
./bin/gs_guc
./bin/gs_basebackup
./bin/gs_probackup
./bin/encrypt
./bin/openssl
./bin/gs_restore
./bin/gs_cgroup
./bin/openssl
./bin/pg_config
./bin/pg_controldata
./bin/pg_format_cu
./bin/pg_resetxlog
./bin/pg_recvlogical
./bin/alarmItem.conf
./bin/retry_errcodes.conf
./bin/cluster_guc.conf
./bin/runsessionstat.sh
./bin/drop_caches.sh
./bin/run_drop_cache.sh
./bin/transfer.py
./bin/gs_plan_simulator.sh
./bin/dependences/clean_temp.sql
./bin/dependences/initdb.py
./bin/dependences/restore_temp.sql
./bin/dependences/store_pg_class_stats.sql
./bin/dependences/store_pg_statistic_ext_stats.sql
./bin/dependences/store_pg_statistic_stats.sql
./bin/dependences/store_pgxc_class.sql
./bin/bind_net_irq.sh
./bin/setArmOptimization.sh
./bin/krb5kdc
./bin/klist
./bin/kinit
./bin/kdestroy
./bin/kdb5_util
./bin/kadmin.local
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
./etc/kerberos/mppdb-site.xml
./share/postgis/PostGIS_install.sh
./share/postgresql/tmp/udstools.py
./share/postgresql/snowball_create.sql
./share/postgresql/pmk_schema.sql
./share/postgresql/pmk_schema_single_inst.sql
./share/postgresql/pg_hba.conf.sample
./share/postgresql/pg_service.conf.sample
./share/postgresql/psqlrc.sample
@ -61,12 +53,11 @@
./share/postgresql/pg_ident.conf.sample
./share/postgresql/postgres.description
./share/postgresql/postgresql.conf.sample
./share/postgresql/mot.conf.sample
./share/postgresql/extension/plpgsql--1.0.sql
./share/postgresql/extension/hstore.control
./share/postgresql/extension/security_plugin.control
./share/postgresql/extension/security_plugin--1.0.sql
./share/postgresql/extension/tsdb.control
./share/postgresql/extension/tsdb--1.0.sql
./share/postgresql/extension/file_fdw--1.0.sql
./share/postgresql/extension/plpgsql.control
./share/postgresql/extension/dist_fdw.control
@ -78,17 +69,10 @@
./share/postgresql/extension/hstore--1.0--1.1.sql
./share/postgresql/extension/hdfs_fdw--1.0.sql
./share/postgresql/extension/hdfs_fdw.control
./share/postgresql/extension/gc_fdw--1.0.sql
./share/postgresql/extension/gc_fdw.control
./share/postgresql/extension/log_fdw--1.0.sql
./share/postgresql/extension/log_fdw.control
./share/postgresql/extension/mot_fdw--1.0.sql
./share/postgresql/extension/mot_fdw.control
./share/postgresql/extension/dimsearch--1.0.sql
./share/postgresql/extension/dimsearch.control
./share/postgresql/extension/packages--1.0.sql
./share/postgresql/extension/packages--1.0--1.1.sql
./share/postgresql/extension/packages.control
./share/postgresql/extension/gsredistribute.control
./share/postgresql/extension/gsredistribute--1.0.sql
./share/postgresql/extension/gsredistribute--unpackaged--1.0.sql
@ -723,6 +707,7 @@
./share/llvmir/GaussDB_expr.ir
./share/sslcert/gsql/openssl.cnf
./share/sslcert/grpc/openssl.cnf
./share/sslcert/om/openssl.cnf
./lib/libsimsearch/
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
@ -745,8 +730,6 @@
./lib/postgresql/utf8_and_sjis.so
./lib/postgresql/utf8_and_cyrillic.so
./lib/postgresql/hstore.so
./lib/postgresql/tsdb.so
./lib/postgresql/packages.so
./lib/postgresql/utf8_and_euc_kr.so
./lib/postgresql/ascii_and_mic.so
./lib/postgresql/utf8_and_iso8859_1.so
@ -761,8 +744,6 @@
./lib/postgresql/utf8_and_euc2004.so
./lib/postgresql/utf8_and_big5.so
./lib/postgresql/mppdb_decoding.so
./lib/postgresql/gsredistribute.so
./lib/postgresql/dimsearch.so
./lib/postgresql/pg_plugin
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
@ -844,6 +825,9 @@
./lib/libverto.so
./lib/libverto.so.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
@ -893,7 +877,6 @@
./lib/postgresql/euc2004_sjis2004.so
./lib/libhll.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h
@ -943,7 +926,6 @@
./include/postgresql/server/utils/rbtree.h
./include/postgresql/server/utils/gs_bitmap.h
./include/postgresql/server/utils/tuplesort.h
./include/postgresql/server/utils/tqual.h
./include/postgresql/server/utils/ps_status.h
./include/postgresql/server/utils/palloc.h
./include/postgresql/server/utils/reltrigger.h
@ -1009,19 +991,19 @@
./include/postgresql/server/securec.h
./include/postgresql/server/securectype.h
./include/postgresql/server/storage/off.h
./include/postgresql/server/storage/block.h
./include/postgresql/server/storage/item.h
./include/postgresql/server/storage/buf/block.h
./include/postgresql/server/storage/item/item.h
./include/postgresql/server/storage/relfilenode.h
./include/postgresql/server/storage/bufpage.h
./include/postgresql/server/storage/buf/bufpage.h
./include/postgresql/server/storage/spin.h
./include/postgresql/server/storage/buf.h
./include/postgresql/server/storage/itemid.h
./include/postgresql/server/storage/pg_sema.h
./include/postgresql/server/storage/itemptr.h
./include/postgresql/server/storage/s_lock.h
./include/postgresql/server/storage/buf/buf.h
./include/postgresql/server/storage/item/itemid.h
./include/postgresql/server/storage/lock/pg_sema.h
./include/postgresql/server/storage/item/itemptr.h
./include/postgresql/server/storage/lock/s_lock.h
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock.h
./include/postgresql/server/storage/lwlock.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1186,8 +1168,8 @@
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./jdbc/gsjdbc4.jar
./jdbc/gsjdbc200.jar
./bin/gs_basebackup
./bin/gs_probackup
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
@ -1230,11 +1212,15 @@
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
@ -1253,8 +1239,6 @@
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./odbc/lib/psqlodbcw.la
./odbc/lib/psqlodbcw.so
[libpq]
./lib/libpq.a
./lib/libpq.so
@ -1290,8 +1274,14 @@
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
[cmlibrary]
./lib/libpgport.a
./include/gs_thread.h
./include/gs_threadlocal.h
./include/postgres_ext.h
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R001C20
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1300,31 +1290,14 @@
./include/pg_config.h
./include/pg_config_manual.h
./include/pg_config_os.h
[version]
V500R001C20
[script]
./script/__init__.py
./script/gs_check
./script/gs_checkos
./script/gs_checkperf
./script/gs_collector
./script/gs_backup
./script/gs_expand
./script/gs_install
./script/gs_om
./script/gs_hotpatch
./script/gs_postuninstall
./script/gs_preinstall
./script/gs_replace
./script/gs_shrink
./script/gs_ssh
./script/gs_sshexkey
./script/gs_uninstall
./script/gs_upgradectl
./script/gs_lcctl
./script/gs_resize
./script/killall
./script/uninstall_force.py
./script/checkRunStatus.py
./script/JsonToDbClustorInfo.py
./script/nodegroup_migrate.sh
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h
./include/xlogdefs.h
./include/cm-libpq-fe.h

View File

@ -1,20 +1,17 @@
[server]
./bin/gs_log
./bin/gsql
./bin/gaussdb
./bin/gaussdb.version.GaussDB200
./bin/gaussdb.version.GaussDB300
./bin/gaussdb.license.GaussDB200_Standard
./bin/gaussmaster
./bin/gstrace
./bin/gs_basebackup
./bin/gs_probackup
./bin/gs_tar
./bin/gs_encrypt
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_ctl
./bin/gs_initdb
./bin/gs_guc
./bin/gs_basebackup
./bin/gs_probackup
./bin/encrypt
./bin/openssl
./bin/gs_restore
@ -24,22 +21,13 @@
./bin/pg_controldata
./bin/pg_format_cu
./bin/pg_resetxlog
./bin/pg_recvlogical
./bin/alarmItem.conf
./bin/retry_errcodes.conf
./bin/cluster_guc.conf
./bin/runsessionstat.sh
./bin/drop_caches.sh
./bin/run_drop_cache.sh
./bin/transfer.py
./bin/getDEK.jar
./bin/gs_plan_simulator.sh
./bin/dependences/clean_temp.sql
./bin/dependences/initdb.py
./bin/dependences/restore_temp.sql
./bin/dependences/store_pg_class_stats.sql
./bin/dependences/store_pg_statistic_ext_stats.sql
./bin/dependences/store_pg_statistic_stats.sql
./bin/dependences/store_pgxc_class.sql
./bin/bind_net_irq.sh
./bin/setArmOptimization.sh
./bin/krb5kdc
./bin/klist
./bin/kinit
@ -47,15 +35,16 @@
./bin/kdb5_util
./bin/kadmin.local
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
./etc/kerberos/mppdb-site.xml
./share/postgis/PostGIS_install.sh
./share/postgresql/tmp/udstools.py
./share/postgresql/snowball_create.sql
./share/postgresql/pmk_schema.sql
./share/postgresql/pmk_schema_single_inst.sql
./share/postgresql/pg_hba.conf.sample
./share/postgresql/pg_service.conf.sample
./share/postgresql/psqlrc.sample
@ -64,14 +53,11 @@
./share/postgresql/pg_ident.conf.sample
./share/postgresql/postgres.description
./share/postgresql/postgresql.conf.sample
./share/postgresql/mot.conf.sample
./share/postgresql/extension/plpgsql--1.0.sql
./share/postgresql/extension/hstore.control
./share/postgresql/extension/security_plugin.control
./share/postgresql/extension/security_plugin--1.0.sql
./share/postgresql/extension/tsdb.control
./share/postgresql/extension/tsdb--1.0.sql
./share/postgresql/extension/streaming--1.0.sql
./share/postgresql/extension/streaming.control
./share/postgresql/extension/file_fdw--1.0.sql
./share/postgresql/extension/plpgsql.control
./share/postgresql/extension/dist_fdw.control
@ -83,17 +69,10 @@
./share/postgresql/extension/hstore--1.0--1.1.sql
./share/postgresql/extension/hdfs_fdw--1.0.sql
./share/postgresql/extension/hdfs_fdw.control
./share/postgresql/extension/gc_fdw--1.0.sql
./share/postgresql/extension/gc_fdw.control
./share/postgresql/extension/log_fdw--1.0.sql
./share/postgresql/extension/log_fdw.control
./share/postgresql/extension/mot_fdw--1.0.sql
./share/postgresql/extension/mot_fdw.control
./share/postgresql/extension/dimsearch--1.0.sql
./share/postgresql/extension/dimsearch.control
./share/postgresql/extension/packages--1.0.sql
./share/postgresql/extension/packages--1.0--1.1.sql
./share/postgresql/extension/packages.control
./share/postgresql/extension/gsredistribute.control
./share/postgresql/extension/gsredistribute--1.0.sql
./share/postgresql/extension/gsredistribute--unpackaged--1.0.sql
@ -728,6 +707,7 @@
./share/llvmir/GaussDB_expr.ir
./share/sslcert/gsql/openssl.cnf
./share/sslcert/grpc/openssl.cnf
./share/sslcert/om/openssl.cnf
./lib/libsimsearch/
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
@ -750,8 +730,6 @@
./lib/postgresql/utf8_and_sjis.so
./lib/postgresql/utf8_and_cyrillic.so
./lib/postgresql/hstore.so
./lib/postgresql/tsdb.so
./lib/postgresql/packages.so
./lib/postgresql/utf8_and_euc_kr.so
./lib/postgresql/ascii_and_mic.so
./lib/postgresql/utf8_and_iso8859_1.so
@ -766,7 +744,6 @@
./lib/postgresql/utf8_and_euc2004.so
./lib/postgresql/utf8_and_big5.so
./lib/postgresql/mppdb_decoding.so
./lib/postgresql/dimsearch.so
./lib/postgresql/pg_plugin
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
@ -900,7 +877,6 @@
./lib/postgresql/euc2004_sjis2004.so
./lib/libhll.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h
@ -950,7 +926,6 @@
./include/postgresql/server/utils/rbtree.h
./include/postgresql/server/utils/gs_bitmap.h
./include/postgresql/server/utils/tuplesort.h
./include/postgresql/server/utils/tqual.h
./include/postgresql/server/utils/ps_status.h
./include/postgresql/server/utils/palloc.h
./include/postgresql/server/utils/reltrigger.h
@ -1016,19 +991,19 @@
./include/postgresql/server/securec.h
./include/postgresql/server/securectype.h
./include/postgresql/server/storage/off.h
./include/postgresql/server/storage/block.h
./include/postgresql/server/storage/item.h
./include/postgresql/server/storage/buf/block.h
./include/postgresql/server/storage/item/item.h
./include/postgresql/server/storage/relfilenode.h
./include/postgresql/server/storage/bufpage.h
./include/postgresql/server/storage/buf/bufpage.h
./include/postgresql/server/storage/spin.h
./include/postgresql/server/storage/buf.h
./include/postgresql/server/storage/itemid.h
./include/postgresql/server/storage/pg_sema.h
./include/postgresql/server/storage/itemptr.h
./include/postgresql/server/storage/s_lock.h
./include/postgresql/server/storage/buf/buf.h
./include/postgresql/server/storage/item/itemid.h
./include/postgresql/server/storage/lock/pg_sema.h
./include/postgresql/server/storage/item/itemptr.h
./include/postgresql/server/storage/lock/s_lock.h
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock.h
./include/postgresql/server/storage/lwlock.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1193,8 +1168,8 @@
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./jdbc/gsjdbc4.jar
./jdbc/gsjdbc200.jar
./bin/gs_basebackup
./bin/gs_probackup
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
@ -1237,11 +1212,15 @@
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
@ -1260,8 +1239,6 @@
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./odbc/lib/psqlodbcw.la
./odbc/lib/psqlodbcw.so
[libpq]
./lib/libpq.a
./lib/libpq.so
@ -1297,8 +1274,14 @@
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
[cmlibrary]
./lib/libpgport.a
./include/gs_thread.h
./include/gs_threadlocal.h
./include/postgres_ext.h
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R001C20
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1318,31 +1301,3 @@
./include/pqexpbuffer.h
./include/xlogdefs.h
./include/cm-libpq-fe.h
[version]
V500R001C20
[script]
./script/__init__.py
./script/gs_check
./script/gs_checkos
./script/gs_checkperf
./script/gs_collector
./script/gs_backup
./script/gs_expand
./script/gs_install
./script/gs_om
./script/gs_hotpatch
./script/gs_postuninstall
./script/gs_preinstall
./script/gs_replace
./script/gs_shrink
./script/gs_ssh
./script/gs_sshexkey
./script/gs_uninstall
./script/gs_upgradectl
./script/gs_lcctl
./script/gs_resize
./script/uninstall_force.py
./script/checkRunStatus.py
./script/JsonToDbClustorInfo.py
./script/killall
./script/nodegroup_migrate.sh

View File

@ -1,58 +1,50 @@
[server]
./bin/gs_log
./bin/gsql
./bin/gaussdb
./bin/gaussdb.version.GaussDB200
./bin/gaussdb.version.GaussDB300
./bin/gaussdb.license.GaussDB200_Standard
./bin/gaussmaster
./bin/gstrace
./bin/gs_basebackup
./bin/gs_probackup
./bin/gs_tar
./bin/gs_encrypt
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_initdb
./bin/gs_ctl
./bin/gs_initdb
./bin/gs_guc
./bin/encrypt
./bin/openssl
./bin/gs_restore
./bin/gs_cgroup
./bin/gs_basebackup
./bin/gs_probackup
./bin/openssl
./bin/pg_config
./bin/pg_controldata
./bin/pg_format_cu
./bin/pg_resetxlog
./bin/pg_recvlogical
./bin/alarmItem.conf
./bin/retry_errcodes.conf
./bin/cluster_guc.conf
./bin/runsessionstat.sh
./bin/drop_caches.sh
./bin/run_drop_cache.sh
./bin/transfer.py
./bin/gs_plan_simulator.sh
./bin/dependences/clean_temp.sql
./bin/dependences/initdb.py
./bin/dependences/restore_temp.sql
./bin/dependences/store_pg_class_stats.sql
./bin/dependences/store_pg_statistic_ext_stats.sql
./bin/dependences/store_pg_statistic_stats.sql
./bin/dependences/store_pgxc_class.sql
./bin/bind_net_irq.sh
./bin/setArmOptimization.sh
./bin/krb5kdc
./bin/klist
./bin/kinit
./bin/kdestroy
./bin/kdb5_util
./bin/kadmin.local
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
./etc/kerberos/mppdb-site.xml
./share/postgis/PostGIS_install.sh
./share/postgresql/tmp/udstools.py
./share/postgresql/snowball_create.sql
./share/postgresql/pmk_schema.sql
./share/postgresql/pmk_schema_single_inst.sql
./share/postgresql/pg_hba.conf.sample
./share/postgresql/pg_service.conf.sample
./share/postgresql/psqlrc.sample
@ -61,12 +53,11 @@
./share/postgresql/pg_ident.conf.sample
./share/postgresql/postgres.description
./share/postgresql/postgresql.conf.sample
./share/postgresql/mot.conf.sample
./share/postgresql/extension/plpgsql--1.0.sql
./share/postgresql/extension/hstore.control
./share/postgresql/extension/security_plugin.control
./share/postgresql/extension/security_plugin--1.0.sql
./share/postgresql/extension/tsdb.control
./share/postgresql/extension/tsdb--1.0.sql
./share/postgresql/extension/file_fdw--1.0.sql
./share/postgresql/extension/plpgsql.control
./share/postgresql/extension/dist_fdw.control
@ -78,17 +69,10 @@
./share/postgresql/extension/hstore--1.0--1.1.sql
./share/postgresql/extension/hdfs_fdw--1.0.sql
./share/postgresql/extension/hdfs_fdw.control
./share/postgresql/extension/gc_fdw--1.0.sql
./share/postgresql/extension/gc_fdw.control
./share/postgresql/extension/log_fdw--1.0.sql
./share/postgresql/extension/log_fdw.control
./share/postgresql/extension/mot_fdw--1.0.sql
./share/postgresql/extension/mot_fdw.control
./share/postgresql/extension/dimsearch--1.0.sql
./share/postgresql/extension/dimsearch.control
./share/postgresql/extension/packages--1.0.sql
./share/postgresql/extension/packages--1.0--1.1.sql
./share/postgresql/extension/packages.control
./share/postgresql/extension/gsredistribute.control
./share/postgresql/extension/gsredistribute--1.0.sql
./share/postgresql/extension/gsredistribute--unpackaged--1.0.sql
@ -686,8 +670,6 @@
./share/postgresql/sql_features.txt
./share/postgresql/pg_cast_oid.txt
./share/postgresql/recovery.conf.sample
./share/postgresql/cm_server.conf.sample
./share/postgresql/cm_agent.conf.sample
./share/postgresql/tsearch_data/english.stop
./share/postgresql/tsearch_data/dutch.stop
./share/postgresql/tsearch_data/hungarian.stop
@ -724,9 +706,8 @@
./share/postgresql/postgres.bki
./share/llvmir/GaussDB_expr.ir
./share/sslcert/gsql/openssl.cnf
./share/sslcert/gds/openssl.cnf
./share/sslcert/grpc/openssl.cnf
./share/sslcert/etcd/openssl.cnf
./share/sslcert/om/openssl.cnf
./lib/libsimsearch/
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
@ -749,8 +730,6 @@
./lib/postgresql/utf8_and_sjis.so
./lib/postgresql/utf8_and_cyrillic.so
./lib/postgresql/hstore.so
./lib/postgresql/tsdb.so
./lib/postgresql/packages.so
./lib/postgresql/utf8_and_euc_kr.so
./lib/postgresql/ascii_and_mic.so
./lib/postgresql/utf8_and_iso8859_1.so
@ -765,8 +744,6 @@
./lib/postgresql/utf8_and_euc2004.so
./lib/postgresql/utf8_and_big5.so
./lib/postgresql/mppdb_decoding.so
./lib/postgresql/gsredistribute.so
./lib/postgresql/dimsearch.so
./lib/postgresql/pg_plugin
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
@ -778,6 +755,9 @@
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libcgroup.so
./lib/libcgroup.so.1
./lib/libcom_err_gauss.so
@ -845,6 +825,9 @@
./lib/libverto.so
./lib/libverto.so.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
@ -878,7 +861,7 @@
./lib/libiconv.so.2.6.1
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.18.0
./lib/libnghttp2.so.14.20.0
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
@ -894,12 +877,14 @@
./lib/postgresql/euc2004_sjis2004.so
./lib/libhll.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h
./include/postgresql/server/datatypes.h
./include/postgresql/server/client_logic/client_logic_enums.h
./include/postgresql/server/nodes/primnodes.h
./include/postgresql/server/nodes/parsenodes.h
./include/postgresql/server/nodes/parsenodes_common.h
./include/postgresql/server/nodes/bitmapset.h
./include/postgresql/server/nodes/pg_list.h
./include/postgresql/server/nodes/value.h
@ -941,7 +926,6 @@
./include/postgresql/server/utils/rbtree.h
./include/postgresql/server/utils/gs_bitmap.h
./include/postgresql/server/utils/tuplesort.h
./include/postgresql/server/utils/tqual.h
./include/postgresql/server/utils/ps_status.h
./include/postgresql/server/utils/palloc.h
./include/postgresql/server/utils/reltrigger.h
@ -1007,19 +991,19 @@
./include/postgresql/server/securec.h
./include/postgresql/server/securectype.h
./include/postgresql/server/storage/off.h
./include/postgresql/server/storage/block.h
./include/postgresql/server/storage/item.h
./include/postgresql/server/storage/buf/block.h
./include/postgresql/server/storage/item/item.h
./include/postgresql/server/storage/relfilenode.h
./include/postgresql/server/storage/bufpage.h
./include/postgresql/server/storage/buf/bufpage.h
./include/postgresql/server/storage/spin.h
./include/postgresql/server/storage/buf.h
./include/postgresql/server/storage/itemid.h
./include/postgresql/server/storage/pg_sema.h
./include/postgresql/server/storage/itemptr.h
./include/postgresql/server/storage/s_lock.h
./include/postgresql/server/storage/buf/buf.h
./include/postgresql/server/storage/item/itemid.h
./include/postgresql/server/storage/lock/pg_sema.h
./include/postgresql/server/storage/item/itemptr.h
./include/postgresql/server/storage/lock/s_lock.h
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock.h
./include/postgresql/server/storage/lwlock.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1145,6 +1129,7 @@
./jre/lib/images/cursors/motif_LinkNoDrop32x32.gif
./jre/lib/images/cursors/motif_MoveDrop32x32.gif
./jre/lib/images/cursors/motif_MoveNoDrop32x32.gif
./jre/lib/javafx-mx.jar
./jre/lib/javafx.properties
./jre/lib/jce.jar
./jre/lib/jexec
@ -1183,8 +1168,8 @@
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./jdbc/gsjdbc4.jar
./jdbc/gsjdbc200.jar
./bin/gs_basebackup
./bin/gs_probackup
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
@ -1224,42 +1209,15 @@
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
./lib/libgssrpc_gauss.so
./lib/libgssrpc_gauss.so.4
./lib/libgssrpc_gauss.so.4.2
./lib/libk5crypto_gauss.so
./lib/libk5crypto_gauss.so.3
./lib/libk5crypto_gauss.so.3.1
./lib/libkrb5support_gauss.so
./lib/libkrb5support_gauss.so.0
./lib/libkrb5support_gauss.so.0.1
./lib/libkrb5_gauss.so
./lib/libkrb5_gauss.so.3
./lib/libkrb5_gauss.so.3.3
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./odbc/lib/psqlodbcw.la
./odbc/lib/psqlodbcw.so
[libpq]
./lib/libpq.a
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libcmpq.so
./lib/libcmpq.so.1
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
@ -1281,12 +1239,49 @@
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
[cmlibrary]
./lib/libconfig.a
./lib/libcmclient.a
./lib/libcmcommon.a
./lib/libcmpq.a
./lib/libpgport.a
[libpq]
./lib/libpq.a
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
./lib/libgssrpc_gauss.so
./lib/libgssrpc_gauss.so.4
./lib/libgssrpc_gauss.so.4.2
./lib/libk5crypto_gauss.so
./lib/libk5crypto_gauss.so.3
./lib/libk5crypto_gauss.so.3.1
./lib/libkrb5support_gauss.so
./lib/libkrb5support_gauss.so.0
./lib/libkrb5support_gauss.so.0.1
./lib/libkrb5_gauss.so
./lib/libkrb5_gauss.so.3
./lib/libkrb5_gauss.so.3.3
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./include/gs_thread.h
./include/gs_threadlocal.h
./include/postgres_ext.h
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R001C20
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1295,30 +1290,14 @@
./include/pg_config.h
./include/pg_config_manual.h
./include/pg_config_os.h
[version]
V500R001C20
[script]
./script/__init__.py
./script/gs_check
./script/gs_checkos
./script/gs_checkperf
./script/gs_collector
./script/gs_backup
./script/gs_expand
./script/gs_install
./script/gs_om
./script/gs_hotpatch
./script/gs_postuninstall
./script/gs_preinstall
./script/gs_replace
./script/gs_shrink
./script/gs_ssh
./script/gs_sshexkey
./script/gs_uninstall
./script/gs_upgradectl
./script/gs_lcctl
./script/gs_resize
./script/uninstall_force.py
./script/checkRunStatus.py
./script/JsonToDbClustorInfo.py
./script/nodegroup_migrate.sh
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h
./include/xlogdefs.h
./include/cm-libpq-fe.h

View File

@ -1,58 +1,50 @@
[server]
./bin/gs_log
./bin/gsql
./bin/gaussdb
./bin/gaussdb.version.GaussDB200
./bin/gaussdb.version.GaussDB300
./bin/gaussdb.license.GaussDB200_Standard
./bin/gaussmaster
./bin/gstrace
./bin/gs_basebackup
./bin/gs_probackup
./bin/gs_tar
./bin/gs_encrypt
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_initdb
./bin/gs_ctl
./bin/gs_initdb
./bin/gs_guc
./bin/encrypt
./bin/openssl
./bin/gs_restore
./bin/gs_cgroup
./bin/gs_basebackup
./bin/gs_probackup
./bin/openssl
./bin/pg_config
./bin/pg_controldata
./bin/pg_format_cu
./bin/pg_resetxlog
./bin/pg_recvlogical
./bin/alarmItem.conf
./bin/retry_errcodes.conf
./bin/cluster_guc.conf
./bin/runsessionstat.sh
./bin/drop_caches.sh
./bin/run_drop_cache.sh
./bin/transfer.py
./bin/gs_plan_simulator.sh
./bin/dependences/clean_temp.sql
./bin/dependences/initdb.py
./bin/dependences/restore_temp.sql
./bin/dependences/store_pg_class_stats.sql
./bin/dependences/store_pg_statistic_ext_stats.sql
./bin/dependences/store_pg_statistic_stats.sql
./bin/dependences/store_pgxc_class.sql
./bin/bind_net_irq.sh
./bin/setArmOptimization.sh
./bin/krb5kdc
./bin/klist
./bin/kinit
./bin/kdestroy
./bin/kdb5_util
./bin/kadmin.local
./bin/lz4
./bin/kadmind
./bin/dbmind
./bin/server.key.cipher
./bin/server.key.rand
./etc/kerberos/kadm5.acl
./etc/kerberos/kdc.conf
./etc/kerberos/krb5.conf
./etc/kerberos/mppdb-site.xml
./share/postgis/PostGIS_install.sh
./share/postgresql/tmp/udstools.py
./share/postgresql/snowball_create.sql
./share/postgresql/pmk_schema.sql
./share/postgresql/pmk_schema_single_inst.sql
./share/postgresql/pg_hba.conf.sample
./share/postgresql/pg_service.conf.sample
./share/postgresql/psqlrc.sample
@ -61,12 +53,11 @@
./share/postgresql/pg_ident.conf.sample
./share/postgresql/postgres.description
./share/postgresql/postgresql.conf.sample
./share/postgresql/mot.conf.sample
./share/postgresql/extension/plpgsql--1.0.sql
./share/postgresql/extension/hstore.control
./share/postgresql/extension/security_plugin.control
./share/postgresql/extension/security_plugin--1.0.sql
./share/postgresql/extension/tsdb.control
./share/postgresql/extension/tsdb--1.0.sql
./share/postgresql/extension/file_fdw--1.0.sql
./share/postgresql/extension/plpgsql.control
./share/postgresql/extension/dist_fdw.control
@ -78,20 +69,15 @@
./share/postgresql/extension/hstore--1.0--1.1.sql
./share/postgresql/extension/hdfs_fdw--1.0.sql
./share/postgresql/extension/hdfs_fdw.control
./share/postgresql/extension/gc_fdw--1.0.sql
./share/postgresql/extension/gc_fdw.control
./share/postgresql/extension/log_fdw--1.0.sql
./share/postgresql/extension/log_fdw.control
./share/postgresql/extension/mot_fdw--1.0.sql
./share/postgresql/extension/mot_fdw.control
./share/postgresql/extension/dimsearch--1.0.sql
./share/postgresql/extension/dimsearch.control
./share/postgresql/extension/packages--1.0.sql
./share/postgresql/extension/packages--1.0--1.1.sql
./share/postgresql/extension/packages.control
./share/postgresql/extension/gsredistribute.control
./share/postgresql/extension/gsredistribute--1.0.sql
./share/postgresql/extension/gsredistribute--unpackaged--1.0.sql
./share/postgresql/extension/postgres_fdw--1.0.sql
./share/postgresql/extension/postgres_fdw.control
./share/postgresql/timezone/GB-Eire
./share/postgresql/timezone/Turkey
./share/postgresql/timezone/Kwajalein
@ -684,8 +670,6 @@
./share/postgresql/sql_features.txt
./share/postgresql/pg_cast_oid.txt
./share/postgresql/recovery.conf.sample
./share/postgresql/cm_server.conf.sample
./share/postgresql/cm_agent.conf.sample
./share/postgresql/tsearch_data/english.stop
./share/postgresql/tsearch_data/dutch.stop
./share/postgresql/tsearch_data/hungarian.stop
@ -723,6 +707,7 @@
./share/llvmir/GaussDB_expr.ir
./share/sslcert/gsql/openssl.cnf
./share/sslcert/grpc/openssl.cnf
./share/sslcert/om/openssl.cnf
./lib/libsimsearch/
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
@ -745,8 +730,6 @@
./lib/postgresql/utf8_and_sjis.so
./lib/postgresql/utf8_and_cyrillic.so
./lib/postgresql/hstore.so
./lib/postgresql/tsdb.so
./lib/postgresql/packages.so
./lib/postgresql/utf8_and_euc_kr.so
./lib/postgresql/ascii_and_mic.so
./lib/postgresql/utf8_and_iso8859_1.so
@ -761,8 +744,6 @@
./lib/postgresql/utf8_and_euc2004.so
./lib/postgresql/utf8_and_big5.so
./lib/postgresql/mppdb_decoding.so
./lib/postgresql/gsredistribute.so
./lib/postgresql/dimsearch.so
./lib/postgresql/pg_plugin
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
@ -774,6 +755,9 @@
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libcgroup.so
./lib/libcgroup.so.1
./lib/libcom_err_gauss.so
@ -841,6 +825,9 @@
./lib/libverto.so
./lib/libverto.so.0
./lib/libverto.so.0.0
./lib/libcurl.so
./lib/libcurl.so.4
./lib/libcurl.so.4.6.0
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
@ -874,7 +861,7 @@
./lib/libiconv.so.2.6.1
./lib/libnghttp2.so
./lib/libnghttp2.so.14
./lib/libnghttp2.so.14.18.0
./lib/libnghttp2.so.14.20.0
./lib/libpcre.so
./lib/libpcre.so.1
./lib/libpcre.so.1.2.12
@ -890,12 +877,14 @@
./lib/postgresql/euc2004_sjis2004.so
./lib/libhll.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h
./include/postgresql/server/datatypes.h
./include/postgresql/server/client_logic/client_logic_enums.h
./include/postgresql/server/nodes/primnodes.h
./include/postgresql/server/nodes/parsenodes.h
./include/postgresql/server/nodes/parsenodes_common.h
./include/postgresql/server/nodes/bitmapset.h
./include/postgresql/server/nodes/pg_list.h
./include/postgresql/server/nodes/value.h
@ -937,7 +926,6 @@
./include/postgresql/server/utils/rbtree.h
./include/postgresql/server/utils/gs_bitmap.h
./include/postgresql/server/utils/tuplesort.h
./include/postgresql/server/utils/tqual.h
./include/postgresql/server/utils/ps_status.h
./include/postgresql/server/utils/palloc.h
./include/postgresql/server/utils/reltrigger.h
@ -1003,19 +991,19 @@
./include/postgresql/server/securec.h
./include/postgresql/server/securectype.h
./include/postgresql/server/storage/off.h
./include/postgresql/server/storage/block.h
./include/postgresql/server/storage/item.h
./include/postgresql/server/storage/buf/block.h
./include/postgresql/server/storage/item/item.h
./include/postgresql/server/storage/relfilenode.h
./include/postgresql/server/storage/bufpage.h
./include/postgresql/server/storage/buf/bufpage.h
./include/postgresql/server/storage/spin.h
./include/postgresql/server/storage/buf.h
./include/postgresql/server/storage/itemid.h
./include/postgresql/server/storage/pg_sema.h
./include/postgresql/server/storage/itemptr.h
./include/postgresql/server/storage/s_lock.h
./include/postgresql/server/storage/buf/buf.h
./include/postgresql/server/storage/item/itemid.h
./include/postgresql/server/storage/lock/pg_sema.h
./include/postgresql/server/storage/item/itemptr.h
./include/postgresql/server/storage/lock/s_lock.h
./include/postgresql/server/storage/backendid.h
./include/postgresql/server/storage/lock.h
./include/postgresql/server/storage/lwlock.h
./include/postgresql/server/storage/lock/lock.h
./include/postgresql/server/storage/lock/lwlock.h
./include/postgresql/server/storage/barrier.h
./include/postgresql/server/storage/shmem.h
./include/postgresql/server/pg_config.h
@ -1141,6 +1129,7 @@
./jre/lib/images/cursors/motif_LinkNoDrop32x32.gif
./jre/lib/images/cursors/motif_MoveDrop32x32.gif
./jre/lib/images/cursors/motif_MoveNoDrop32x32.gif
./jre/lib/javafx-mx.jar
./jre/lib/javafx.properties
./jre/lib/jce.jar
./jre/lib/jexec
@ -1179,8 +1168,8 @@
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./jdbc/gsjdbc4.jar
./jdbc/gsjdbc200.jar
./bin/gs_basebackup
./bin/gs_probackup
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/postgresql/euc_kr_and_mic.so
@ -1220,46 +1209,15 @@
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
./lib/libgssrpc_gauss.so
./lib/libgssrpc_gauss.so.4
./lib/libgssrpc_gauss.so.4.2
./lib/libk5crypto_gauss.so
./lib/libk5crypto_gauss.so.3
./lib/libk5crypto_gauss.so.3.1
./lib/libkrb5support_gauss.so
./lib/libkrb5support_gauss.so.0
./lib/libkrb5support_gauss.so.0.1
./lib/libkrb5_gauss.so
./lib/libkrb5_gauss.so.3
./lib/libkrb5_gauss.so.3.3
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./odbc/lib/psqlodbcw.la
./odbc/lib/psqlodbcw.so
[libpq]
./lib/libpq.a
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libcmclient.so
./lib/libcmclient.so.1
./lib/libcmcommon.so
./lib/libcmcommon.so.2
./lib/libcmpq.so
./lib/libcmpq.so.1
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
@ -1281,10 +1239,49 @@
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
[cmlibrary]
./lib/libconfig.a
./lib/libcmpq.a
./lib/libpgport.a
[libpq]
./lib/libpq.a
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libpq_ce.so
./lib/libpq_ce.so.5
./lib/libpq_ce.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libstdc++.so.6
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
./lib/libgssrpc_gauss.so
./lib/libgssrpc_gauss.so.4
./lib/libgssrpc_gauss.so.4.2
./lib/libk5crypto_gauss.so
./lib/libk5crypto_gauss.so.3
./lib/libk5crypto_gauss.so.3.1
./lib/libkrb5support_gauss.so
./lib/libkrb5support_gauss.so.0
./lib/libkrb5support_gauss.so.0.1
./lib/libkrb5_gauss.so
./lib/libkrb5_gauss.so.3
./lib/libkrb5_gauss.so.3.3
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./include/gs_thread.h
./include/gs_threadlocal.h
./include/postgres_ext.h
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h
[version]
V500R001C20
[header]
./include/libpq-fe.h
./include/postgres_ext.h
@ -1293,30 +1290,14 @@
./include/pg_config.h
./include/pg_config_manual.h
./include/pg_config_os.h
[version]
V500R001C20
[script]
./script/__init__.py
./script/gs_check
./script/gs_checkos
./script/gs_checkperf
./script/gs_collector
./script/gs_backup
./script/gs_expand
./script/gs_install
./script/gs_om
./script/gs_hotpatch
./script/gs_postuninstall
./script/gs_preinstall
./script/gs_replace
./script/gs_shrink
./script/gs_ssh
./script/gs_sshexkey
./script/gs_uninstall
./script/gs_upgradectl
./script/gs_lcctl
./script/gs_resize
./script/uninstall_force.py
./script/checkRunStatus.py
./script/JsonToDbClustorInfo.py
./script/nodegroup_migrate.sh
./include/cm_config.h
./include/c.h
./include/port.h
./include/cm_msg.h
./include/cm_c.h
./include/cm_misc.h
./include/libpq-int.h
./include/pqcomm.h
./include/pqexpbuffer.h
./include/xlogdefs.h
./include/cm-libpq-fe.h

View File

@ -787,6 +787,7 @@
./lib/libatomic.so.1
./lib/libatomic.so.1.2.0
./lib/libgpr.so
./lib/libmasstree.so
./lib/libgpr.so.9
./lib/libgpr.so.9.0.0
./lib/libgrpc.so
@ -892,8 +893,6 @@
./lib/postgresql/latin2_and_win1250.so
./lib/postgresql/euc2004_sjis2004.so
./lib/libhll.so
./include/postgresql/server/postgres_ext.h
./include/postgresql/server/pg_config_os.h
./include/postgresql/server/pgtime.h

310
build/script/package_opengauss.sh Normal file → Executable file
View File

@ -19,6 +19,7 @@
declare version_mode='release'
declare binarylib_dir='None'
#detect platform information.
PLATFORM=32
bit=$(getconf LONG_BIT)
@ -31,25 +32,25 @@ kernel=""
version=""
if [ -f "/etc/openEuler-release" ]
then
kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/openEuler-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/openEuler-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
elif [ -f "/etc/centos-release" ]
then
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
elif [ -f "/etc/euleros-release" ]
then
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
kernel=$(cat /etc/centos-release | awk -F ' ' '{print $1}' | tr A-Z a-z)
version=$(cat /etc/centos-release | awk -F '(' '{print $2}'| awk -F ')' '{print $1}' | tr A-Z a-z)
else
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
version=$(lsb_release -r | awk -F ' ' '{print $2}')
kernel=$(lsb_release -d | awk -F ' ' '{print $2}'| tr A-Z a-z)
version=$(lsb_release -r | awk -F ' ' '{print $2}')
fi
## to solve kernel="name=openeuler"
if echo $kernel | grep -q 'openeuler'
then
kernel="openeuler"
kernel="openeuler"
fi
if [ X"$kernel" == X"centos" ]; then
@ -66,7 +67,9 @@ else
exit 1
fi
gcc_version="8.2"
declare release_file_list="opengauss_release_list_${kernel}_single"
declare dest_list=""
##add platform architecture information
PLATFORM_ARCH=$(uname -p)
if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
@ -74,6 +77,8 @@ if [ "$PLATFORM_ARCH"X == "aarch64"X ] ; then
echo "We only support NUMA on openEuler(aarch64), EulerOS(aarch64), Kylin(aarch64) platform."
exit 1
fi
release_file_list="opengauss_release_list_${kernel}_aarch64_single"
fi
##default install version storage path
@ -102,19 +107,6 @@ function print_help()
"
}
SCRIPT_PATH=${0}
FIRST_CHAR=$(expr substr "$SCRIPT_PATH" 1 1)
if [ "$FIRST_CHAR" = "/" ]; then
SCRIPT_PATH=${0}
else
SCRIPT_PATH="$(pwd)/${SCRIPT_PATH}"
fi
SCRIPT_DIR=$(cd $(dirname $SCRIPT_PATH) && pwd)
test -d ${SCRIPT_DIR}/../../output || mkdir -p ${SCRIPT_DIR}/../../output
output_path=$(cd ${SCRIPT_DIR}/../../output && pwd)
#######################################################################
##version 1.1.0
#######################################################################
@ -123,19 +115,38 @@ function read_srv_version()
cd $SCRIPT_DIR
version_number=$(grep 'VERSION' opengauss.spec | awk -F "=" '{print $2}')
echo "${server_name_for_package}-${version_number}">version.cfg
#auto read the number from kernal globals.cpp, no need to change it here
}
function deploy_pkgs()
###################################
# get version number from globals.cpp
##################################
function read_srv_number()
{
for pkg in $@; do
if [ -f $pkg ]; then
mv $pkg $output_path/
fi
done
global_kernal="${ROOT_DIR}/src/common/backend/utils/init/globals.cpp"
version_name="GRAND_VERSION_NUM"
version_num=""
line=$(cat $global_kernal | grep ^const* | grep $version_name)
version_num1=${line#*=}
#remove the symbol;
version_num=$(echo $version_num1 | tr -d ";")
#remove the blank
version_num=$(echo $version_num)
if echo $version_num | grep -qE '^92[0-9]+$'
then
# get the last three number
latter=${version_num:2}
echo "92.${latter}" >>${SCRIPT_DIR}/version.cfg
else
echo "Cannot get the version number from globals.cpp."
exit 1
fi
}
read_srv_version
SCRIPT_DIR=$(cd $(dirname $0) && pwd)
test -d ${SCRIPT_DIR}/../../output || mkdir -p ${SCRIPT_DIR}/../../output && rm -fr ${SCRIPT_DIR}/../../output/*
output_path=$(cd ${SCRIPT_DIR}/../../output && pwd)
#########################################################################
##read command line paramenters
@ -174,6 +185,7 @@ while [ $# -gt 0 ]; do
esac
done
read_srv_version
#######################################################################
## declare all package name
@ -198,12 +210,11 @@ fi
PG_REG_TEST_ROOT="${ROOT_DIR}/"
PMK_SCHEMA="${ROOT_DIR}/script/pmk_schema.sql"
#declare LOG_FILE="${ROOT_DIR}/package/make_package.log"
declare LOG_FILE="${SCRIPT_DIR}/make_package.log"
declare BUILD_DIR="${ROOT_DIR}/mppdb_temp_install"
BUILD_TOOLS_PATH="${ROOT_DIR}/binarylibs/buildtools/${PLAT_FORM_STR}"
BINARYLIBS_PATH="${ROOT_DIR}/binarylibs/dependency/${PLAT_FORM_STR}"
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql/open_gauss"
declare UPGRADE_SQL_DIR="${ROOT_DIR}/src/include/catalog/upgrade_sql"
if [ "${binarylib_dir}"x != "None"x ]
then
echo "binarylib dir : ${binarylib_dir}"
@ -211,40 +222,26 @@ then
BINARYLIBS_PATH="${binarylib_dir}/dependency/${PLAT_FORM_STR}"
fi
gcc_version="7.3"
export CC=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/gcc
export CXX=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin/g++
export LD_LIBRARY_PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/lib64:$BUILD_TOOLS_PATH/gcc$gcc_version/isl/lib:$BUILD_TOOLS_PATH/gcc$gcc_version/mpc/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/mpfr/lib/:$BUILD_TOOLS_PATH/gcc$gcc_version/gmp/lib/:$LD_LIBRARY_PATH
export PATH=$BUILD_TOOLS_PATH/gcc$gcc_version/gcc/bin:$PATH
###################################
# get version number from globals.cpp
##################################
function read_svr_number()
{
cd $SCRIPT_DIR
echo "${server_name_for_package}-${version_number}">version.cfg
global_kernal="${ROOT_DIR}/src/common/backend/utils/init/globals.cpp"
version_name="GRAND_VERSION_NUM"
version_num=""
line=$(cat $global_kernal | grep ^const* | grep $version_name)
version_num1=${line#*=}
#remove the symbol;
version_num=$(echo $version_num1 | tr -d ";")
#remove the blank
version_num=$(echo $version_num)
read_srv_number
if echo $version_num | grep -qE '^92[0-9]+$'
then
# get the last three number
latter=${version_num:2}
echo "92.${latter}" >>${SCRIPT_DIR}/version.cfg
else
echo "Cannot get the version number from globals.cpp."
exit 1
fi
#######################################################################
# move pkgs to output directory
#######################################################################
function deploy_pkgs()
{
for pkg in $@; do
if [ -f $pkg ]; then
mv $pkg $output_path/
fi
done
}
read_svr_number
#######################################################################
# Print log.
@ -270,28 +267,13 @@ die()
#######################################################################
function install_gaussdb()
{
cd $ROOT_DIR
# cp -f ${BINARYLIBS_PATH}/openssl/comm/bin/openssl ${BUILD_DIR}/bin/
# cp ${BUILD_DIR}/bin/script/gspylib/etc/sql/pmk_schema.sql ${BUILD_DIR}/share/postgresql/
# if [ -f ${BUILD_DIR}/bin/script/gspylib/etc/sql/pmk_schema_single_inst.sql ]; then
# cp ${BUILD_DIR}/bin/script/gspylib/etc/sql/pmk_schema_single_inst.sql ${BUILD_DIR}/share/postgresql/
# fi
# cd $ROOT_DIR
# cp -f ${SCRIPT_DIR}/other/transfer.py ${BUILD_DIR}/bin
# if [ $? -ne 0 ]; then
# die "cp -f ${SCRIPT_DIR}/script/transfer.py ${BUILD_DIR}/bin failed."
# fi
# dos2unix ${BUILD_DIR}/bin/transfer.py > /dev/null 2>&1
cd $SCRIPT_DIR
if [ "$version_mode" = "release" ]; then
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
mv symbols.tar.gz $kernel_symbol_package_name
deploy_pkgs $kernel_symbol_package_name
chmod +x ./separate_debug_information.sh
./separate_debug_information.sh
cd $SCRIPT_DIR
mv symbols.tar.gz $kernel_symbol_package_name
deploy_pkgs $kernel_symbol_package_name
fi
#insert the commitid to version.cfg as the upgrade app path specification
@ -299,7 +281,7 @@ function install_gaussdb()
export LD_LIBRARY_PATH=${BUILD_DIR}/lib:$LD_LIBRARY_PATH
commitid=$(LD_PRELOAD='' ${BUILD_DIR}/bin/gaussdb -V | awk '{print $5}' | cut -d ")" -f 1)
if [ -z $commitid ]
if [ -z "$commitid" ]
then
commitid=$(date "+%Y%m%d%H%M%S")
commitid=${commitid:4:8}
@ -313,10 +295,10 @@ function install_gaussdb()
#######################################################################
function copy_files_list()
{
for element in `ls $1`
for element in $(ls $1)
do
dir_or_file=$1"/"$element
if [ -d $dir_or_file ]
if [ -d "$dir_or_file" ]
then
copy_files_list $dir_or_file $2
else
@ -324,6 +306,7 @@ function copy_files_list()
fi
done
}
#######################################################################
##copy target file into temporary directory temp
#######################################################################
@ -335,19 +318,6 @@ function target_file_copy()
copy_files_list $file $2
done
# clean unnecessary files
rm -f $2/bin/makesgml
rm -f $2/lib/libecpg*
rm -f $2/lib/libdoprapatch.a
rm -f $2/lib/libpgtypes.a
rm -f $2/lib/libpgport.a
rm -f $2/lib/libz.a
rm -f $2/lib/libpq_ce.a
rm -fr $2/lib/postgresql/pgxs/src/test
rm -f $2/lib/postgresql/test_decoding.so
rm -fr $2/lib/krb5/plugins/preauth
rm -fr $2/lib/krb5/plugins/tls
cp ${SCRIPT_DIR}/version.cfg ${BUILD_DIR}/temp
if [ $? -ne 0 ]; then
die "copy ${SCRIPT_DIR}/version.cfg to ${BUILD_DIR}/temp failed"
@ -383,22 +353,49 @@ function target_file_copy()
fi
}
function target_file_copy_for_non_server()
{
cd ${BUILD_DIR}
for file in $(echo $1)
do
copy_files_list $file $2
done
}
#######################################################################
##function make_package_prep have two actions
##1.parse release_file_list variable represent file
##2.copy target file into a newly created temporary directory temp
#######################################################################
function prep_dest_list()
{
cd $SCRIPT_DIR
releasefile=$1
pkgname=$2
local head=$(cat $releasefile | grep "\[$pkgname\]" -n | awk -F: '{print $1}')
if [ ! -n "$head" ]; then
die "error: ono find $pkgname in the $releasefile file "
fi
local tail=$(cat $releasefile | sed "1,$head d" | grep "^\[" -n | sed -n "1p" | awk -F: '{print $1}')
if [ ! -n "$tail" ]; then
local all=$(cat $releasefile | wc -l)
let tail=$all+1-$head
fi
dest_list=$(cat $releasefile | awk "NR==$head+1,NR==$tail+$head-1")
}
function make_package_srv()
{
echo "Begin package server"
cd $SCRIPT_DIR
copydest="./bin
./etc
./share
./lib
./include"
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
rm -rf temp
mkdir -p temp
prep_dest_list $release_file_list 'server'
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp/etc
target_file_copy "$copydest" ${BUILD_DIR}/temp
target_file_copy "$dest_list" ${BUILD_DIR}/temp
deploy_pkgs ${sha256_name} ${kernel_package_name}
echo "make server(all) package success!"
@ -438,59 +435,15 @@ function make_package_upgrade_sql()
echo "Successfully packaged upgrade_sql files."
}
function target_file_copy_for_non_server()
{
for file in $(echo $1)
do
tar -cpf - $file | ( cd $2; tar -xpf - )
done
}
function make_package_libpq()
{
cd $SCRIPT_DIR
dest="./lib/libpq.a
./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
./lib/libgssrpc_gauss.so
./lib/libgssrpc_gauss.so.4
./lib/libgssrpc_gauss.so.4.2
./lib/libk5crypto_gauss.so
./lib/libk5crypto_gauss.so.3
./lib/libk5crypto_gauss.so.3.1
./lib/libkrb5support_gauss.so
./lib/libkrb5support_gauss.so.0
./lib/libkrb5support_gauss.so.0.1
./lib/libkrb5_gauss.so
./lib/libkrb5_gauss.so.3
./lib/libkrb5_gauss.so.3.3
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./include/gs_thread.h
./include/gs_threadlocal.h
./include/postgres_ext.h
./include/libpq-fe.h
./include/libpq-events.h
./include/libpq/libpq-fs.h"
prep_dest_list $release_file_list 'libpq'
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
rm -rf temp
mkdir temp
target_file_copy_for_non_server "$dest" ${BUILD_DIR}/temp
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
cd ${BUILD_DIR}/temp
echo "packaging libpq..."
@ -507,47 +460,14 @@ function make_package_libpq()
function make_package_tools()
{
cd $SCRIPT_DIR
dest="./lib/libpq.so
./lib/libpq.so.5
./lib/libpq.so.5.5
./lib/libconfig.so
./lib/libconfig.so.4
./lib/libcrypto.so
./lib/libcrypto.so.1.1
./lib/libssl.so
./lib/libssl.so.1.1
./lib/libpgport_tool.so
./lib/libpgport_tool.so.1
./lib/libgssapi_krb5_gauss.so
./lib/libgssapi_krb5_gauss.so.2
./lib/libgssapi_krb5_gauss.so.2.2
./lib/libgssrpc_gauss.so
./lib/libgssrpc_gauss.so.4
./lib/libgssrpc_gauss.so.4.2
./lib/libk5crypto_gauss.so
./lib/libk5crypto_gauss.so.3
./lib/libk5crypto_gauss.so.3.1
./lib/libkrb5support_gauss.so
./lib/libkrb5support_gauss.so.0
./lib/libkrb5support_gauss.so.0.1
./lib/libkrb5_gauss.so
./lib/libkrb5_gauss.so.3
./lib/libkrb5_gauss.so.3.3
./lib/libcom_err_gauss.so
./lib/libcom_err_gauss.so.3
./lib/libcom_err_gauss.so.3.0
./bin/gsql
./bin/gs_dump
./bin/gs_dumpall
./bin/gs_restore
./bin/gs_basebackup
./bin/gs_probackup"
prep_dest_list $release_file_list 'client'
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}
rm -rf temp
mkdir temp
target_file_copy_for_non_server "$dest" ${BUILD_DIR}/temp
rm -rf ${BUILD_DIR}/temp
mkdir -p ${BUILD_DIR}/temp
cd ${BUILD_DIR}/
target_file_copy_for_non_server "$dest_list" ${BUILD_DIR}/temp
cd ${BUILD_DIR}/temp
echo "packaging tools..."

35
configure vendored
View File

@ -788,6 +788,7 @@ docdir
oldincludedir
includedir
with_3rdpartydir
with_jdk
localstatedir
sharedstatedir
sysconfdir
@ -867,6 +868,7 @@ with_libxslt
with_system_tzdata
with_zlib
with_gnu_ld
with_jdk
enable_largefile
enable_float4_byval
enable_float8_byval
@ -6486,6 +6488,39 @@ fi
#
# JDK
#
with_jdk=''
if [ ! -z "${with_3rdpartydir}" ]; then
platstr=$(sh src/get_PlatForm_str.sh)
for d in "openjdk8" "huaweijdk8"; do
$as_echo "$as_me:$LINENO: checking for jdk in ${with_3rdpartydir}/platform/${platstr}/${d}" >&5
if [ ! -d "${with_3rdpartydir}/platform/${platstr}/${d}" ]; then
$as_echo "$as_me:$LINENO: result: no" >&5
continue
fi
for d2 in $(ls "${with_3rdpartydir}/platform/${platstr}/${d}" | sort -r 2>/dev/null); do
if [ -f "${with_3rdpartydir}/platform/${platstr}/${d}/${d2}/jre/bin/java" ]; then
with_jdk="${with_3rdpartydir}/platform/${platstr}/${d}/${d2}"
break;
fi
done
if [ ! -z "$with_jdk" ]; then
$as_echo "$as_me:$LINENO: result: yes" >&5
break;
fi
done
if [ -z "$with_jdk" ]; then
$as_echo "$as_me:$LINENO: error: there is no jdk (containing jre) found in 3rd party repo" >&5
$as_echo "$as_me: error: there is no jdk (containing jre) found in 3rd party repo" >&2
exit 1
fi
fi
#
# Zlib

View File

@ -111,7 +111,6 @@ BEGIN
if not exists (select j.job_id, p.what
from pg_job j, pg_job_proc p
where j.dbname = database_name and j.job_id = p.job_id and p.what like 'call redis_ts_table(%') then
raise notice 'No redis_ts_table task exists for database %, so do not need to cancel task', database_name;
return;
end if;
-- the job can only submit once
@ -143,6 +142,7 @@ DECLARE
BEGIN
select current_database() into database_name;
if not exists (select * from public.redis_timeseries_detail) then
raise exception 'no ts_table is in redistribution';
return;
end if;
for var_r in (select reloid from public.redis_timeseries_detail) loop
@ -168,15 +168,12 @@ LANGUAGE plpgsql;
-- drop the partition if it is empty, if it is last partition, just drop the table
CREATE OR REPLACE FUNCTION pg_catalog.redis_ts_table(
--the old table in old nodes, relname is redis_old_
IN redis_oid oid,
IN transfer_interval interval
)
IN redis_oid oid)
RETURNS void
AS
$$
DECLARE
v_count int;
time_column_name name;
old_rel_name name;
new_rel_name name;
origin_relname name;
@ -211,66 +208,56 @@ BEGIN
end if;
-- cannot just set in current transaction, the kernel check the usess, input parameter must be false
sql := 'select set_config(''enable_cluster_resize'', ''on'', false)';
sql = 'select set_config(''enable_cluster_resize'', ''on'', false)';
execute sql;
select attname from pg_attribute where attkvtype = 3 and attrelid = redis_oid into time_column_name;
select relname, boundaries[1] from pg_partition where parttype = 'p' and parentid = redis_oid
order by boundaries[1] desc limit 1 into part_name, start_time;
sql := 'select count(*) from (select * from "'||schemaname||'"."'||old_rel_name||'" partition('||part_name||') limit 1);';
-- table is empty drop it
sql = 'select count(*) from "'||schemaname||'"."'||old_rel_name||'";';
execute sql into v_count;
-- if this partition has no value, drop this partition or drop this table
-- no data in old_rel_name drop the table
if v_count = 0 then
sql := 'select count(*) from (select * from pg_partition where parttype = ''p'' and parentid = '||redis_oid||' limit 2);';
execute sql into v_count;
if v_count = 1 then
-- drop the redis_view and rule cascade
sql = 'drop table if exists "'||schemaname||'"."'||old_rel_name||'" cascade;';
execute sql;
--cannot drop table redis_old_ because this task need it, in the task, if we cancel the task, it will raise error
sql = 'alter table "'||schemaname||'"."'||new_rel_name||'" rename to "'||origin_relname||'";';
execute sql;
return;
else
sql = 'alter table "'||schemaname||'"."'||old_rel_name||'" drop partition "'||part_name||'";';
execute sql;
end if;
-- drop the redis_view and rule cascade
sql = 'drop table if exists "'||schemaname||'"."'||old_rel_name||'" cascade;';
execute sql;
sql = 'alter table "'||schemaname||'"."'||new_rel_name||'" rename to "'||origin_relname||'";';
execute sql;
return;
end if;
-- the partition must has value, so execute delete this time
max_try_transfer = 0;
-- we have already handle condition with empty table, at least one partition should have data
while 1 loop
sql := 'select timestamp '''||start_time||''' - interval '''||transfer_interval||''';';
execute sql into end_time;
sql := 'insert into "'||schemaname||'"."'||new_rel_name||
'" select * from "'||schemaname||'"."'||old_rel_name||'" partition("'||part_name||'")
where "'||time_column_name||'" between '''||start_time||''' and '''||end_time||''';';
execute sql;
GET DIAGNOSTICS i_count = ROW_COUNT;
if i_count = 0 then
start_time = end_time;
-- for the last partition, if we just try to drop by time interval, it may be very long, so we just execute 50 times and then transfer all the partition
if max_try_transfer >= 50 then
sql := 'select count(*) from (select * from pg_partition where parttype = ''p'' and parentid = '||redis_oid||' limit 2);';
execute sql into v_count;
if v_count = 1 then
-- next run time job will do the last drop rule and table
sql := 'insert into "'||schemaname||'"."'||new_rel_name||
'" select * from "'||schemaname||'"."'||old_rel_name||'" partition("'||part_name||'");';
execute sql;
sql := 'truncate "'||schemaname||'"."'||old_rel_name||'";';
execute sql;
return;
end if;
end if;
else
sql := 'delete from "'||schemaname||'"."'||old_rel_name||'" where "'||time_column_name||'" between '''
||start_time||''' and '''||end_time||''';';
select relname from pg_partition where parttype = 'p' and parentid = redis_oid
order by boundaries[1] desc limit 1 into part_name;
sql := 'select count(*) from "'||schemaname||'"."'||old_rel_name||'" partition('||part_name||');';
execute sql into v_count;
-- if this partition has no value, drop this partition
if v_count = 0 then
sql = 'alter table "'||schemaname||'"."'||old_rel_name||'" drop partition "'||part_name||'";';
execute sql;
return;
CONTINUE;
else
EXIT;
end if;
max_try_transfer := max_try_transfer + 1;
end loop;
-- the partition has value, so execute delete this time
sql = 'set session_timeout = 0;';
execute sql;
sql = 'set enable_analyze_check = off;';
execute sql;
sql = 'insert into "'||schemaname||'"."'||new_rel_name||
'" select * from "'||schemaname||'"."'||old_rel_name||'" partition("'||part_name||'") ';
execute sql;
sql = 'select count(*) from pg_partition where parentid = '||redis_oid||' and parttype = ''p'';';
execute sql into v_count;
-- if only only one partition left drop table cascade
if v_count = 1 then
sql = 'drop table if exists "'||schemaname||'"."'||old_rel_name||'" cascade;';
execute sql;
sql = 'alter table "'||schemaname||'"."'||new_rel_name||'" rename to "'||origin_relname||'";';
execute sql;
else
sql = 'alter table "'||schemaname||'"."'||old_rel_name||'" drop partition "'||part_name||'";';
execute sql;
end if;
END;
$$
LANGUAGE plpgsql;
@ -278,7 +265,6 @@ LANGUAGE plpgsql;
-- submit the redis_ts_table task for one table, old_oid means redis_old_ which exists in the old group
CREATE OR REPLACE FUNCTION pg_catalog.submit_redis_task(
IN old_oid oid,
IN transfer_interval interval default '10 minutes',
IN schedule_interval interval default '1 minute'
)
RETURNS void
@ -299,7 +285,7 @@ BEGIN
end if;
sql := ' SELECT EXTRACT(epoch FROM interval '''||schedule_interval||''')/3600';
EXECUTE sql INTO time_interval;
sql := 'SELECT DBE_TASK.submit(''call redis_ts_table('||old_oid||','''''||transfer_interval||''''');'',
sql := 'SELECT DBE_TASK.submit(''call redis_ts_table('||old_oid||');'',
sysdate, ''sysdate + '||time_interval||' / 24'');';
EXECUTE sql into job_id;
-- if drop the table redis_new_ or redis_old_, must cancel the task mannual
@ -309,7 +295,6 @@ LANGUAGE plpgsql;
-- the first is the time column that transfer to other table, the second is the intervel that call the job
CREATE OR REPLACE FUNCTION pg_catalog.submit_all_redis_task(
IN transfer_interval interval default '10 minutes',
IN schedule_interval interval default '1 minute')
RETURNS void
AS
@ -336,9 +321,8 @@ BEGIN
c.relkind = ''r'' and c.parttype=''p'' and xc.pgroup='''||old_group_name||'''
and xc.pcrelid = c.oid and c.relname like ''redis_old_%''';
for var_r in execute sql loop
sql := 'select pg_catalog.submit_redis_task('||var_r.oid||', '
||quote_literal(transfer_interval)||', '
||quote_literal(schedule_interval)||');';
sql := 'select pg_catalog.submit_redis_task('||var_r.oid||',
'||quote_literal(schedule_interval)||');';
execute sql;
end loop;
END;

0
contrib/gsredistribute/gsredistribute.cpp Normal file → Executable file
View File

0
contrib/mppdb_decoding/mppdb_decoding.cpp Executable file → Normal file
View File

View File

@ -188,10 +188,14 @@ static void help(const char* progname)
" -V, --version output version information, then exit\n"
" -x extended (show additional columns)\n"
" -?, --help show this help, then exit\n"
"\nThe default action is to show all database OIDs.\n\n"
"Report bugs to <pgsql-bugs@postgresql.org>.\n",
"\nThe default action is to show all database OIDs.\n",
progname,
progname);
#if ((defined(ENABLE_MULTIPLE_NODES)) || (defined(ENABLE_PRIVATEGAUSS)))
printf("\nReport bugs to GaussDB support.\n");
#else
printf("\nReport bugs to openGauss community by raising an issue.\n");
#endif
}
void* pg_malloc(size_t size)

View File

@ -27,9 +27,9 @@ install:install-data
top_builddir ?= ../../
include $(top_builddir)/src/Makefile.global
ORACLE_FDW_DIR=output
ORACLE_FDW_PACKAGE=ORACLE_FDW_2_1_0
ORACLE_FDW_UNZIPPED_PACKAGE=oracle_fdw-ORACLE_FDW_2_1_0
ORACLE_FDW_PATCH=opengauss_oracle_fdw-2.1.0_patch
ORACLE_FDW_PACKAGE=oracle_fdw-ORACLE_FDW_2_2_0
ORACLE_FDW_UNZIPPED_PACKAGE=oracle_fdw-ORACLE_FDW_2_2_0
ORACLE_FDW_PATCH=opengauss_oracle_fdw-2.2.0_patch
ORACLE_FDW_MEGRED_SOURCES_DIR=$(ORACLE_FDW_DIR)/code
.PHONY: oracle_fdw_target
@ -38,8 +38,8 @@ oracle_fdw_target: prep_checked
@make -C $(ORACLE_FDW_MEGRED_SOURCES_DIR)/$(ORACLE_FDW_UNZIPPED_PACKAGE) NO_PGXS=1
prep_checked:
@test -f $(ORCFDW_HOME)/$(ORACLE_FDW_PACKAGE).zip || ( echo "ERROR: You need copy oracle_fdw from 'third_party' repo to 'third_party_binarylibs' repo and keep directory strucutre unchanged" && exit 1 )
@test -f $(ORCFDW_HOME)/$(ORACLE_FDW_PACKAGE).zip && date > prep_checked
@test -f $(ORCFDW_HOME)/$(ORACLE_FDW_PACKAGE).tar.gz || ( echo "ERROR: You need copy oracle_fdw from 'third_party' repo to 'third_party_binarylibs' repo and keep directory strucutre unchanged" && exit 1 )
@test -f $(ORCFDW_HOME)/$(ORACLE_FDW_PACKAGE).tar.gz && date > prep_checked
.PHONY: install-data
install-data: oracle_fdw_target
@ -53,14 +53,6 @@ define create_oracle_fdw_sources
mkdir $(ORACLE_FDW_DIR);\
cp -r $(ORCFDW_HOME)/. $(ORACLE_FDW_DIR);\
mkdir $(ORACLE_FDW_MEGRED_SOURCES_DIR); \
unzip -o $(ORACLE_FDW_DIR)/$(ORACLE_FDW_PACKAGE).zip -d $(ORACLE_FDW_MEGRED_SOURCES_DIR) &> /dev/null; \
for ((i=1;i<=99;i++)); \
do \
file_name="$(ORACLE_FDW_DIR)/$$i-oracle_fdw-2.2.0_patch.patch"; \
if [ ! -f "$$file_name" ]; then \
exit 0; \
fi; \
patch -p0 -d $(ORACLE_FDW_MEGRED_SOURCES_DIR)/$(ORACLE_FDW_UNZIPPED_PACKAGE) < $$file_name &> /dev/null; \
done
tar -xzvf $(ORACLE_FDW_DIR)/$(ORACLE_FDW_PACKAGE).tar.gz -C $(ORACLE_FDW_MEGRED_SOURCES_DIR) &> /dev/null; \
patch -p0 -d $(ORACLE_FDW_MEGRED_SOURCES_DIR)/$(ORACLE_FDW_UNZIPPED_PACKAGE) < $(ORACLE_FDW_DIR)/$(ORACLE_FDW_PATCH).patch &> /dev/null;
endef

25
contrib/pagehack/pagehack.cpp Executable file → Normal file
View File

@ -1014,9 +1014,12 @@ static void usage(const char* progname)
" -d only for test, use 0xFF to fill the last half page[4k]\n"
"\nCommon options:\n"
" --help, -h show this help, then exit\n"
" --version, -V output version information, then exit\n"
"\n"
"Report bugs to <pgsql-bugs@postgresql.org>.\n");
" --version, -V output version information, then exit\n");
#if ((defined(ENABLE_MULTIPLE_NODES)) || (defined(ENABLE_PRIVATEGAUSS)))
printf("\nReport bugs to GaussDB support.\n");
#else
printf("\nReport bugs to openGauss community by raising an issue.\n");
#endif
}
static bool HexStringToInt(char* hex_string, int* result)
@ -2787,6 +2790,7 @@ static int parse_page_file(const char* filename, SegmentType type, const uint32
if ((0 == size) || (0 != size % BLCKSZ)) {
fprintf(stderr, "The page file size is not an exact multiple of BLCKSZ\n");
fclose(fd);
return false;
}
@ -2795,6 +2799,7 @@ static int parse_page_file(const char* filename, SegmentType type, const uint32
/* parse */
if (start >= blknum) {
fprintf(stderr, "start point exceeds the total block number of relation.\n");
fclose(fd);
return false;
} else if ((start + number) > blknum) {
fprintf(stderr,
@ -2817,11 +2822,13 @@ static int parse_page_file(const char* filename, SegmentType type, const uint32
result = fread(buffer, 1, BLCKSZ, fd);
if (BLCKSZ != result) {
fprintf(stderr, "Reading error");
fclose(fd);
return false;
}
if (!parse_a_page(buffer, start, blknum, type)) {
fprintf(stderr, "Error during parsing block %d/%d\n", start, blknum);
fclose(fd);
return false;
}
@ -3962,12 +3969,20 @@ static bool parse_dw_single_flush_file(const char* file_name)
result = fread(file_head, 1, BLCKSZ, fd);
if (BLCKSZ != result) {
fprintf(stderr, "Reading error");
free(item);
free(unaligned_buf);
free(unaligned_buf2);
fclose(fd);
return false;
}
fseek(fd, BLCKSZ, SEEK_SET);
result = fread(item_buf, 1, blk_num * BLCKSZ, fd);
if (blk_num * BLCKSZ != result) {
fprintf(stderr, "Reading error");
free(item);
free(unaligned_buf);
free(unaligned_buf2);
fclose(fd);
return false;
}
@ -4023,6 +4038,10 @@ static bool parse_dw_single_flush_file(const char* file_name)
result = fread(dw_block, 1, BLCKSZ, fd);
if (BLCKSZ != result) {
fprintf(stderr, "Reading error");
free(item);
free(unaligned_buf);
free(unaligned_buf2);
fclose(fd);
return false;
}
if (temp->buf_tag.rnode.bucketNode == -1) {

View File

@ -242,7 +242,11 @@ static void usage(void)
"Or for use as a standalone archive cleaner:\n"
"e.g.\n"
" pg_archivecleanup /mnt/server/archiverdir 000000010000000000000010.00000020.backup\n");
printf("\nReport bugs to <community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#if ((defined(ENABLE_MULTIPLE_NODES)) || (defined(ENABLE_PRIVATEGAUSS)))
printf("\nReport bugs to GaussDB support.\n");
#else
printf("\nReport bugs to community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#endif
}
/*------------ MAIN ----------------------------------------*/

View File

@ -494,7 +494,11 @@ static void usage(void)
" restore_command = 'pg_standby [OPTION]... ARCHIVELOCATION %%f %%p %%r'\n"
"e.g.\n"
" restore_command = 'pg_standby /mnt/server/archiverdir %%f %%p %%r'\n");
printf("\nReport bugs to <community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#if ((defined(ENABLE_MULTIPLE_NODES)) || (defined(ENABLE_PRIVATEGAUSS)))
printf("\nReport bugs to GaussDB support.\n");
#else
printf("\nReport bugs to community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#endif
}
#ifndef WIN32

0
contrib/pg_trgm/trgm_op.cpp Normal file → Executable file
View File

9
contrib/pgbench/pgbench.cpp Normal file → Executable file
View File

@ -466,11 +466,14 @@ static void usage(const char* progname)
" -U USERNAME connect as specified database user\n"
" -W PASSWORD connect as specified database user through explicit password\n"
" -V, --version output version information, then exit\n"
" -?, --help show this help, then exit\n"
"\n"
"Report bugs to <community@opengauss.org> or join opengauss community <https://opengauss.org>.\n",
" -?, --help show this help, then exit\n",
progname,
progname);
#if ((defined(ENABLE_MULTIPLE_NODES)) || (defined(ENABLE_PRIVATEGAUSS)))
printf("\nReport bugs to GaussDB support.\n");
#else
printf("\nReport bugs to community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#endif
}
/* random number generator: uniform distribution from min to max inclusive */

0
contrib/postgis/extension_dependency.h Executable file → Normal file
View File

0
contrib/postgres_fdw/.gitignore vendored Normal file → Executable file
View File

0
contrib/postgres_fdw/Makefile Normal file → Executable file
View File

0
contrib/postgres_fdw/connection.cpp Normal file → Executable file
View File

0
contrib/postgres_fdw/deparse.cpp Normal file → Executable file
View File

0
contrib/postgres_fdw/expected/postgres_fdw.out Normal file → Executable file
View File

0
contrib/postgres_fdw/option.cpp Normal file → Executable file
View File

0
contrib/postgres_fdw/postgres_fdw--1.0.sql Normal file → Executable file
View File

0
contrib/postgres_fdw/postgres_fdw.control Normal file → Executable file
View File

0
contrib/postgres_fdw/postgres_fdw.cpp Normal file → Executable file
View File

0
contrib/postgres_fdw/postgres_fdw.h Normal file → Executable file
View File

0
contrib/postgres_fdw/sql/postgres_fdw.sql Normal file → Executable file
View File

0
contrib/security_plugin/access_audit.cpp Normal file → Executable file
View File

0
contrib/security_plugin/access_audit.h Normal file → Executable file
View File

0
contrib/security_plugin/gs_audit_policy.cpp Normal file → Executable file
View File

0
contrib/security_plugin/gs_audit_policy.h Normal file → Executable file
View File

0
contrib/security_plugin/gs_mask_policy.h Normal file → Executable file
View File

0
contrib/security_plugin/gs_policy_filter.cpp Normal file → Executable file
View File

0
contrib/security_plugin/gs_policy_filter.h Normal file → Executable file
View File

0
contrib/security_plugin/gs_policy_labels.cpp Normal file → Executable file
View File

0
contrib/security_plugin/gs_policy_labels.h Normal file → Executable file
View File

0
contrib/security_plugin/gs_policy_logical_tree.cpp Normal file → Executable file
View File

0
contrib/security_plugin/gs_policy_logical_tree.h Normal file → Executable file
View File

34
contrib/security_plugin/gs_policy_object_types.cpp Normal file → Executable file
View File

@ -251,6 +251,38 @@ PolicyLabelItem::PolicyLabelItem(const char *schema, const char *object, const c
}
}
void PolicyLabelItem::init(const PolicyLabelItem &arg)
{
m_schema = arg.m_schema;
m_object = arg.m_object;
errno_t rc = memset_s(m_column, sizeof(m_column), 0, sizeof(m_column));
securec_check(rc, "\0", "\0");
if (arg.m_column != NULL && strlen(arg.m_column) > 0)
{
rc = snprintf_s(m_column, sizeof(m_column), strlen(arg.m_column), "%s", arg.m_column);
securec_check_ss(rc, "\0", "\0");
}
m_obj_type = arg.m_obj_type;
}
PolicyLabelItem::PolicyLabelItem(const PolicyLabelItem &arg)
{
if (this == &arg) {
return;
}
init(arg);
}
PolicyLabelItem &PolicyLabelItem::operator=(const PolicyLabelItem &arg)
{
if (this == &arg) {
return *this;
}
init(arg);
return *this;
}
/*
* set_object
* set m_obj_type and objid by given parameters.
@ -354,8 +386,8 @@ bool get_function_name(long long funcid, PolicyLabelItem *func_label)
const char *procname = func_rel->proname.data;
func_label->m_schema = func_rel->pronamespace;
ReleaseSysCache(tuple);
func_label->set_object(procname, O_FUNCTION);
ReleaseSysCache(tuple);
return true;
}

3
contrib/security_plugin/gs_policy_object_types.h Normal file → Executable file
View File

@ -118,7 +118,10 @@ struct PolicyLabelItem {
PolicyLabelItem(const char *schema = "", const char *object = "",
const char *column = "", int obj_type = O_TABLE);
PolicyLabelItem(Oid schema, Oid object, int obj_type, const char *column = "");
PolicyLabelItem(const PolicyLabelItem &arg);
PolicyLabelItem &operator=(const PolicyLabelItem &arg);
void init(const PolicyLabelItem &arg);
void get_fqdn_value(gs_stl::gs_string *value) const;
bool operator < (const PolicyLabelItem& arg) const;

2
contrib/security_plugin/gs_policy_plugin.cpp Normal file → Executable file
View File

@ -572,7 +572,7 @@ static inline void set_cursor_stmt_as_masked(const char* name, const masking_res
(*masked_cursor_stmts)[name] = (*result);
}
void set_result_set_function(const PolicyLabelItem func)
void set_result_set_function(const PolicyLabelItem &func)
{
if (result_set_functions == NULL) {
result_set_functions = new gs_policy_label_set;

2
contrib/security_plugin/gs_policy_plugin.h Normal file → Executable file
View File

@ -46,7 +46,7 @@ void get_remote_addr(IPV6 *ip);
const char* get_session_app_name();
const char* GetUserName(char* user_name, size_t user_name_size);
bool get_ipaddress(gs_stl::gs_string& ipaddress);
void set_result_set_function(const PolicyLabelItem func);
void set_result_set_function(const PolicyLabelItem &func);
void get_name_range_var(const RangeVar *rangevar, gs_stl::gs_string *buffer, bool enforce = true);
CmdType get_rte_commandtype(RangeTblEntry *rte);
extern void load_database_policy_info();

View File

@ -136,9 +136,8 @@ static bool mask_func(ParseState *pstate, Expr*& expr,
bool is_masking = false;
if (nodeTag(expr) == T_FuncExpr) {
FuncExpr *fe = (FuncExpr *)(expr);
{
PolicyLabelItem func_value;
get_function_name(fe->funcid, &func_value);
PolicyLabelItem func_value;
if (get_function_name(fe->funcid, &func_value)) {
set_result_set_function(func_value);
}
if (fe->args != NULL) {
@ -161,8 +160,9 @@ static void parse_func(Node* expr)
FuncExpr *fe = (FuncExpr *)expr;
{
PolicyLabelItem func_value;
get_function_name(fe->funcid, &func_value);
set_result_set_function(func_value);
if (get_function_name(fe->funcid, &func_value)) {
set_result_set_function(func_value);
}
}
if (fe->args != NIL) {
ListCell* temp = NULL;
@ -826,75 +826,72 @@ static bool mask_list_parameters(List **params, ParseState *pstate, bool *is_mas
return *is_masking;
}
static bool mask_sublink(ParseState *pstate, Expr*& expr,
const policy_set *policy_ids, masking_result *result, List* rtable, bool can_mask)
{
if (expr == NULL) {
return false;
}
SubLink *sublink = (SubLink *) expr;
Query *query = (Query *) sublink->subselect;
ListCell* temp = NULL;
bool is_masking = false;
foreach (temp, query->targetList) {
TargetEntry *old_tle = (TargetEntry *) lfirst(temp);
is_masking = parser_target_entry(pstate, old_tle, policy_ids, result, query->rtable, can_mask) || is_masking;
}
return is_masking;
}
static bool mask_expr_node(ParseState *pstate, Expr*& expr,
const policy_set *policy_ids, masking_result *result, List* rtable, bool can_mask)
{
if (expr == NULL) {
return false;
}
bool is_masking = false;
switch (nodeTag(expr)) {
case T_SubLink:
{
SubLink *sublink = (SubLink *) expr;
Query *query = (Query *) sublink->subselect;
ListCell* temp = NULL;
foreach (temp, query->targetList) {
TargetEntry *old_tle = (TargetEntry *) lfirst(temp);
parser_target_entry(pstate, old_tle, policy_ids, result, query->rtable, can_mask);
}
}
break;
return mask_sublink(pstate, expr, policy_ids, result, rtable, can_mask);
case T_FuncExpr:
{
bool func_masked = mask_func(pstate, expr, policy_ids, result, rtable, can_mask);
is_masking = func_masked || is_masking;
}
break;
return mask_func(pstate, expr, policy_ids, result, rtable, can_mask);
case T_Var:
{
bool var_masked = handle_masking_node(pstate, expr, policy_ids, result, rtable, can_mask);
is_masking = var_masked || is_masking;
}
break;
case T_RelabelType:
{
return handle_masking_node(pstate, expr, policy_ids, result, rtable, can_mask);
case T_RelabelType: {
RelabelType *relabel = (RelabelType *) expr;
if (relabel->arg != NULL) {
bool expr_masked = mask_expr_node(pstate, (Expr *&)relabel->arg, policy_ids, result, rtable, can_mask);
is_masking = expr_masked || is_masking;
return mask_expr_node(pstate, (Expr *&)relabel->arg, policy_ids, result, rtable, can_mask);
}
break;
}
break;
case T_CoerceViaIO:
{
case T_CoerceViaIO: {
CoerceViaIO *coerce = (CoerceViaIO *) expr;
if (coerce->arg != NULL) {
bool expr_masked = mask_expr_node(pstate, (Expr *&)coerce->arg, policy_ids, result, rtable, false);
is_masking = expr_masked || is_masking;
return mask_expr_node(pstate, (Expr *&)coerce->arg, policy_ids, result, rtable, false);
}
break;
}
break;
case T_Aggref:
{
case T_Aggref: {
Aggref *agg = (Aggref *) expr;
if (agg->args != NIL && list_length(agg->args) > 0) {
bool is_masking = false;
mask_list_parameters(&(agg->args), pstate, &is_masking, policy_ids, result, rtable, can_mask);
return is_masking;
}
break;
}
break;
case T_OpExpr:
{
case T_OpExpr: {
OpExpr *opexpr = (OpExpr *) expr;
if (opexpr->args != NIL && list_length(opexpr->args) > 0) {
bool is_masking = false;
mask_list_parameters(&(opexpr->args), pstate, &is_masking, policy_ids, result, rtable, can_mask);
return is_masking;
}
break;
}
break;
default:
break;
}
return is_masking;
return false;
}
bool parser_target_entry(ParseState *pstate, TargetEntry *&old_tle,

0
contrib/security_plugin/privileges_audit.cpp Normal file → Executable file
View File

2
contrib/security_plugin/privileges_audit.h Normal file → Executable file
View File

@ -33,8 +33,6 @@
typedef std::pair<gs_stl::gs_string, gs_stl::gs_string> names_pair;
void acl_audit_object(const policy_set *security_policy_ids, const policy_set *policy_ids,
const names_pair names, int priv_type, const char *priv_name, int objtype);
void extracted(policy_simple_set& policy_result, bool ignore_db, const char* priv_name, const PolicyLabelItem* item,
const gs_stl::gs_string& obj_value);
bool internal_audit_object_str(const policy_set* security_policy_ids, const policy_set* policy_ids,
const PolicyLabelItem* item, int priv_type, const char* priv_name, const char* objname = "",
bool ignore_db = false);

0
contrib/unaccent/unaccent.cpp Normal file → Executable file
View File

View File

@ -343,8 +343,11 @@ static void usage(const char* progname)
printf(" -U USERNAME user name to connect as\n");
printf(" -w never prompt for password\n");
printf(" -W force password prompt\n");
printf("\n");
printf("Report bugs to <community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#if ((defined(ENABLE_MULTIPLE_NODES)) || (defined(ENABLE_PRIVATEGAUSS)))
printf("\nReport bugs to GaussDB support.\n");
#else
printf("\nReport bugs to community@opengauss.org> or join opengauss community <https://opengauss.org>.\n");
#endif
}
int main(int argc, char** argv)

0
contrib/xml2/xpath.cpp Normal file → Executable file
View File

View File

@ -42,7 +42,6 @@ Complete list of usable sgml source files in this directory.
<!ENTITY alterUser SYSTEM "alter_user.sgml">
<!ENTITY alterUserMapping SYSTEM "alter_user_mapping.sgml">
<!ENTITY alterView SYSTEM "alter_view.sgml">
<!ENTITY alterRule SYSTEM "alter_rule.sgml">
<!ENTITY analyze SYSTEM "analyze.sgml">
<!ENTITY begin SYSTEM "begin.sgml">
<!## XC>

0
doc/src/sgml/ref/alter_audit_policy.sgmlin Normal file → Executable file
View File

0
doc/src/sgml/ref/alter_role.sgmlin Normal file → Executable file
View File

View File

@ -45,15 +45,10 @@ column_clause
| ENABLE TRIGGER [ trigger_name | ALL | USER ]
| ENABLE REPLICA TRIGGER trigger_name
| ENABLE ALWAYS TRIGGER trigger_name
| DISABLE RULE rewrite_rule_name
| ENABLE RULE rewrite_rule_name
| ENABLE REPLICA RULE rewrite_rule_name
| ENABLE ALWAYS RULE rewrite_rule_name
| ENABLE ROW LEVEL SECURITY
| DISABLE ROW LEVEL SECURITY
| FORCE ROW LEVEL SECURITY
| NO FORCE ROW LEVEL SECURITY
| REPLICA IDENTITY {DEFAULT | USING INDEX index_name | FULL | NOTHING}
where column_clause can be:
ADD [ COLUMN ] column_name data_type [ compress_mode ] [ COLLATE collation ] [ column_constraint [ ... ] ]
| MODIFY column_name data_type

0
doc/src/sgml/ref/alter_user.sgmlin Normal file → Executable file
View File

0
doc/src/sgml/ref/create_audit_policy.sgmlin Normal file → Executable file
View File

0
doc/src/sgml/ref/drop_audit_policy.sgmlin Normal file → Executable file
View File

0
docker/dockerfiles/1.0.0/dockerfile_arm Executable file → Normal file
View File

36
docker/dockerfiles/1.0.0/entrypoint.sh Executable file → Normal file
View File

@ -1,4 +1,26 @@
#!/usr/bin/env bash
#!/bin/bash
# entrypoint of docker file
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2028. All rights reserved.
#
#openGauss is licensed under Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
#-------------------------------------------------------------------------
#
# entrypoint.sh
# entrypoint of docker file
#
# IDENTIFICATION
# GaussDBKernel/server/docker/dockerfiles/1.0.0/entrypoint.sh
#
#-------------------------------------------------------------------------
set -Eeo pipefail
# usage: file_env VAR [DEFAULT]
@ -12,20 +34,20 @@ export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local file_var="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
if [ "${!var:-}" ] && [ "${!file_var:-}" ]; then
echo >&2 "error: both $var and $file_var are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
elif [ "${!file_var:-}" ]; then
val="$(< "${!file_var}")"
fi
export "$var"="$val"
unset "$fileVar"
unset "$file_var"
}
# check to see if this file is being run or sourced from another script

36
docker/dockerfiles/1.0.1/entrypoint.sh Executable file → Normal file
View File

@ -1,4 +1,26 @@
#!/usr/bin/env bash
#!/bin/bash
# entrypoint of docker file
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2028. All rights reserved.
#
#openGauss is licensed under Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
#-------------------------------------------------------------------------
#
# entrypoint.sh
# entrypoint of docker file
#
# IDENTIFICATION
# GaussDBKernel/server/docker/dockerfiles/1.0.1/entrypoint.sh
#
#-------------------------------------------------------------------------
set -Eeo pipefail
# usage: file_env VAR [DEFAULT]
@ -12,20 +34,20 @@ export LD_LIBRARY_PATH=$GAUSSHOME/lib:$LD_LIBRARY_PATH
file_env() {
local var="$1"
local fileVar="${var}_FILE"
local file_var="${var}_FILE"
local def="${2:-}"
if [ "${!var:-}" ] && [ "${!fileVar:-}" ]; then
echo >&2 "error: both $var and $fileVar are set (but are exclusive)"
if [ "${!var:-}" ] && [ "${!file_var:-}" ]; then
echo >&2 "error: both $var and $file_var are set (but are exclusive)"
exit 1
fi
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
elif [ "${!file_var:-}" ]; then
val="$(< "${!file_var}")"
fi
export "$var"="$val"
unset "$fileVar"
unset "$file_var"
}
# check to see if this file is being run or sourced from another script

View File

@ -18,7 +18,7 @@ RUN set -eux; \
mkdir /docker-entrypoint-initdb.d && \
cp /tmp/wal2json.so /usr/local/opengauss && \
tar -jxf openGauss-1.1.0-CentOS-64bit.tar.bz2 -C /usr/local/opengauss && \
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
chmod 2777 /var/run/opengauss && \
rm -rf openGauss-1.1.0-CentOS-64bit.tar.bz2 && yum clean all
@ -39,5 +39,5 @@ RUN chmod 755 /usr/local/bin/entrypoint.sh;ln -s /usr/local/bin/entrypoint.sh /
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 5432
EXPOSE 5432
CMD ["gaussdb"]

View File

@ -13,10 +13,10 @@ RUN set -eux; \
useradd -u 70 -g omm -d /home/omm omm; \
mkdir -p /var/lib/opengauss && \
mkdir -p /usr/local/opengauss && \
mkdir -p /var/run/opengauss && \
mkdir -p /var/run/opengauss && \
mkdir /docker-entrypoint-initdb.d && \
tar -jxf openGauss-1.1.0-openEuler-64bit.tar.bz2 -C /usr/local/opengauss && \
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
chown -R omm:omm /var/run/opengauss && chown -R omm:omm /usr/local/opengauss && chown -R omm:omm /var/lib/opengauss && chown -R omm:omm /docker-entrypoint-initdb.d && \
chmod 2777 /var/run/opengauss && \
rm -rf openGauss-1.1.0-openEuler-64bit.tar.bz2 && yum clean all
@ -37,5 +37,5 @@ RUN chmod 755 /usr/local/bin/entrypoint.sh;ln -s /usr/local/bin/entrypoint.sh /
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 5432
EXPOSE 5432
CMD ["gaussdb"]

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
set -Eeo pipefail
set -Eeo pipefail
# usage: file_env VAR [DEFAULT]
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
@ -86,7 +86,7 @@ docker_init_database_dir() {
else
# eval 'gs_initdb --pwfile=<(echo "$GS_PASSWORD") --nodename=gaussdb '"$POSTGRES_INITDB_ARGS"' "$@"'
eval 'gs_initdb --pwfile=<(echo "$GS_PASSWORD") --nodename=gaussdb -D $PGDATA'
fi
fi
# unset/cleanup "nss_wrapper" bits
if [ "${LD_PRELOAD:-}" = '/usr/lib/libnss_wrapper.so' ]; then
rm -f "$NSS_WRAPPER_PASSWD" "$NSS_WRAPPER_GROUP"
@ -183,7 +183,7 @@ docker_process_sql() {
if [ -n "$GS_DB" ]; then
query_runner+=( --dbname "$GS_DB" )
fi
echo "Execute SQL: ${query_runner[@]} $@"
"${query_runner[@]}" "$@"
}
@ -208,7 +208,7 @@ docker_setup_user() {
GS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$GS_PASSWORD" --set user="$GS_USERNAME" <<-'EOSQL'
create user :"user" with login password :"passwd" ;
EOSQL
else
else
echo " default user is gaussdb"
fi
}
@ -219,7 +219,7 @@ docker_setup_rep_user() {
GS_DB= docker_process_sql --dbname postgres --set passwd="RepUser@2020" --set user="repuser" <<-'EOSQL'
create user :"user" SYSADMIN REPLICATION password :"passwd" ;
EOSQL
else
else
echo " default no repuser created"
fi
}
@ -271,7 +271,7 @@ opengauss_setup_postgresql_conf() {
echo "password_encryption_type = 0"
echo "wal_level = logical"
fi
if [ -n "$SERVER_MODE" ]; then
echo "listen_addresses = '0.0.0.0'"
echo "most_available_sync = on"
@ -293,7 +293,7 @@ opengauss_setup_postgresql_conf() {
if [ -n "$OTHER_PG_CONF" ]; then
echo -e "$OTHER_PG_CONF"
fi
fi
} >> "$PGDATA/postgresql.conf"
}
@ -335,9 +335,9 @@ cp /usr/local/opengauss/wal2json.so /usr/local/opengauss/lib/postgresql
GS_DB= docker_process_sql --dbname postgres --set db="$GS_DB" --set passwd="$GS_PASSWORD" --set user="$GS_USERNAME" <<-'EOSQL'
select * from pg_create_logical_replication_slot('wal2json', 'wal2json');
create table gaussdb.test (id int primary key, name varchar2(20));
insert into gaussdb.test values(1,'yun');
insert into gaussdb.test values(2,'he');
insert into gaussdb.test values(3,'enmo');
insert into gaussdb.test values(1,'yun');
insert into gaussdb.test values(2,'he');
insert into gaussdb.test values(3,'enmo');
ALTER TABLE gaussdb.test REPLICA IDENTITY FULL;
EOSQL
}

40
docker/dockerfiles/buildDockerImage.sh Executable file → Normal file
View File

@ -1,4 +1,26 @@
#!/bin/bash -e
#!/bin/bash
# Build docker image
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2028. All rights reserved.
#
#openGauss is licensed under Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
#-------------------------------------------------------------------------
#
# buildDockerImage.sh
# Build docker image
#
# IDENTIFICATION
# GaussDBKernel/server/docker/dockerfiles/buildDockerImage.sh
#
#-------------------------------------------------------------------------
usage() {
cat << EOF
@ -19,8 +41,8 @@ EOF
}
# Validate packages
checksumPackages() {
if [ $arch = "amd64" ]; then
checksum_packages() {
if [ "${arch}" = "amd64" ]; then
md5_file="md5_file_amd64"
else
md5_file="md5_file_arm64"
@ -40,7 +62,7 @@ fi
# Check Docker version
checkDockerVersion() {
check_docker_version() {
# Get Docker Server version
echo "Checking Docker version."
DOCKER_VERSION=$(docker version --format '{{.Server.Version | printf "%.5s" }}'|| exit 0)
@ -66,8 +88,8 @@ VERSION="1.0.0"
SKIPMD5=0
DOCKEROPS=""
MIN_DOCKER_VERSION="17.09"
arch=`case $(uname -m) in i386) echo "386" ;; i686) echo "386" ;; x86_64) echo "amd64";; aarch64)echo "arm64";; esac`
if [ $arch = "amd64" ]; then
arch=$(case $(uname -m) in i386) echo "386" ;; i686) echo "386" ;; x86_64) echo "amd64";; aarch64)echo "arm64";; esac)
if [ "${arch}" = "amd64" ]; then
DOCKERFILE="dockerfile_amd"
else
DOCKERFILE="dockerfile_arm"
@ -104,7 +126,7 @@ while getopts "hesxiv:o:" optname; do
esac
done
checkDockerVersion
check_docker_version
@ -123,7 +145,7 @@ cd "$VERSION" || {
}
if [ ! "$SKIPMD5" -eq 1 ]; then
checksumPackages
checksum_packages
else
echo "Ignored MD5 checksum."
fi
@ -174,7 +196,7 @@ docker build --force-rm=true --no-cache=true \
yes | docker image prune > /dev/null
BUILD_END=$(date '+%s')
BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START`
BUILD_ELAPSED=$(expr $BUILD_END - $BUILD_START)
echo ""
echo ""

24
docker/dockerfiles/create_master_slave.sh Executable file → Normal file
View File

@ -1,6 +1,26 @@
#!/bin/bash -e
# Parameters
#!/bin/bash
# create master and slave
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2028. All rights reserved.
#
#openGauss is licensed under Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
#
# http://license.coscl.org.cn/MulanPSL2
#
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details.
#-------------------------------------------------------------------------
#
# create_master_slave.sh
# create master and slave
#
# IDENTIFICATION
# GaussDBKernel/server/docker/dockerfiles/create_master_slave.sh
#
#-------------------------------------------------------------------------
#set OG_SUBNET,GS_PASSWORD,MASTER_IP,SLAVE_1_IP,MASTER_HOST_PORT,MASTER_LOCAL_PORT,SLAVE_1_HOST_PORT,SLAVE_1_LOCAL_PORT,MASTER_NODENAME,SLAVE_NODENAME

1232
escan.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -273,6 +273,7 @@ endif
#############################################################################
# Saved arguments form configure
with_3rd = @with_3rdpartydir@
with_jdk = @with_jdk@
ifeq ($(with_3rd), NONE)
BINARYPATH = binarylibs/dependency/$(PLAT_FORM_STR)
@ -737,7 +738,12 @@ else # not PGXS
endif
endif
override CPPFLAGS := $(CPPFLAGS) -I$(LIBODBC_INCLUDE_PATH) -I$(LIBOBS_INCLUDE_PATH) -I$(LIBCGROUP_INCLUDE_PATH) -I$(LIBOPENSSL_INCLUDE_PATH) -I${LIBORC_INCLUDE_PATH} -I${LIBPARQUET_INCLUDE_PATH} -I${PROTOBUF_INCLUDE_PATH} -I${GRPC_INCLUDE_PATH} -I${BOOST_INCLUDE_PATH} -I$(LIBLLVM_INCLUDE_PATH) -I$(KERBEROS_INCLUDE_PATH) -I$(HLL_INCLUDE_PATH) -I$(CJSON_INCLUDE_PATH) -I$(LIBEDIT_INCLUDE_PATH) -I$(EVENT_INCLUDE_PATH) -I$(NUMA_INCLUDE_PATH) -I$(ZLIB_INCLUDE_PATH) -I$(LZ4_INCLUDE_PATH) -I$(LIBCURL_INCLUDE_PATH)
override CPPFLAGS := $(CPPFLAGS) -I$(LIBODBC_INCLUDE_PATH) -I$(LIBOBS_INCLUDE_PATH) -I$(LIBCGROUP_INCLUDE_PATH) -I$(LIBOPENSSL_INCLUDE_PATH) -I${LIBORC_INCLUDE_PATH} -I${LIBPARQUET_INCLUDE_PATH} -I${PROTOBUF_INCLUDE_PATH} -I${GRPC_INCLUDE_PATH} -I${BOOST_INCLUDE_PATH} -I$(LIBLLVM_INCLUDE_PATH) -I$(KERBEROS_INCLUDE_PATH) -I$(HLL_INCLUDE_PATH) -I$(CJSON_INCLUDE_PATH) -I$(LIBEDIT_INCLUDE_PATH) -I$(NUMA_INCLUDE_PATH) -I$(ZLIB_INCLUDE_PATH) -I$(LZ4_INCLUDE_PATH) -I$(LIBCURL_INCLUDE_PATH)
ifeq ($(enable_multiple_nodes), yes)
# GDS links to libevent
override CPPFLAGS := $(CPPFLAGS) -I$(EVENT_INCLUDE_PATH)
endif
ifeq ($(SUPPORT_HOTPATCH), yes)
override CPPFLAGS := $(CPPFLAGS) -I$(LIBHOTPATCH_INCLUDE_PATH)
@ -1071,7 +1077,7 @@ endif
libpq = -L$(libpq_builddir) -lpq
ifneq ($(enable_multiple_nodes)_$(enable_privategauss), no_no)
libpq_ce = -L$(libpq_builddir) -lpq_ce -L$(top_builddir)/src/distribute/bin/gs_ktool/ -lgs_ktool -lsecurec -lkmc
libpq_ce = -L$(libpq_builddir) -lpq_ce -L$(top_builddir)/src/bin/gs_ktool/ -lgs_ktool -lsecurec -lkmc
else
libpq_ce = -L$(libpq_builddir) -lpq_ce
endif

View File

@ -34,7 +34,8 @@ SUBDIRS = \
gsqlerr \
pg_upgrade \
pg_basebackup \
pg_probackup
pg_probackup \
gs_ktool
ifeq ($(PORTNAME), win32)
SUBDIRS += pgevent
@ -56,7 +57,9 @@ SUBDIRS = \
pg_basebackup \
pg_probackup
ifeq ($(enable_privategauss), yes)
SUBDIRS += gs_ktool
endif
endif

0
src/bin/gs_cgroup/cgconf.cpp Executable file → Normal file
View File

0
src/bin/gs_cgroup/cgexec.cpp Executable file → Normal file
View File

6
src/bin/gs_cgroup/cgptree.cpp Executable file → Normal file
View File

@ -877,6 +877,12 @@ static struct controller_info* cgptree_get_controller_list(void)
error = cgroup_get_controller_next(&ctrl_handle, &info);
if (error && error != ECGEOF) {
fprintf(stderr, "get next controller failed: %s\n", cgroup_strerror(error));
if (curr_cinfo->ctrl_name != NULL)
free(curr_cinfo->ctrl_name);
if (curr_cinfo->mount_point != NULL)
free(curr_cinfo->mount_point);
cgptree_free_group_tree(curr_cinfo->group_head);
free(curr_cinfo);
break;
}

0
src/bin/gs_cgroup/cgutil.h Executable file → Normal file
View File

0
src/bin/gs_cgroup/main.cpp Executable file → Normal file
View File

View File

@ -26,10 +26,9 @@ ifneq "$(MAKECMDGOALS)" "clean"
endif
COMMON_OBJS = $(top_builddir)/src/lib/elog/elog.a
EXTRA_OBJS = $(top_builddir)/src/gausskernel/cbb/utils/aes/aes.o
OBJS = pg_guc.o cluster_config.o cluster_guc.o pg_hba.o $(top_builddir)/src/lib/elog/elog.a \
$(top_builddir)/src/lib/config/libconfig.a $(EXTRA_OBJS)
$(top_builddir)/src/lib/config/libconfig.a
all:gs_guc encrypt

4
src/bin/gs_guc/cluster_config.cpp Executable file → Normal file
View File

@ -964,7 +964,11 @@ int save_guc_para_info()
continue;
} else if (strncmp(line_info, "[cmserver]", sizeof("[cmserver]")) == 0) {
is_cmserver = true;
#ifdef ENABLE_MULTIPLE_NODES
is_gtm = false;
#else
is_cndn = false;
#endif
continue;
} else if (strncmp(line_info, "[cmagent]", sizeof("[cmagent]")) == 0) {
is_cmagent = true;

76
src/bin/gs_guc/cluster_guc.conf Normal file → Executable file
View File

@ -28,7 +28,6 @@ cpu_operator_cost|real|0,1.79769e+308|NULL|NULL|
cpu_tuple_cost|real|0,1.79769e+308|NULL|NULL|
random_page_cost|real|0,1.79769e+308|NULL|NULL|
seq_page_cost|real|0,1.79769e+308|NULL|NULL|
agg_redistribute_enhancement|bool|0,0|NULL|NULL|
alarm_component|string|0,0|NULL|NULL|
alarm_report_interval|int|0,2147483647|NULL|NULL|
allow_concurrent_tuple_update|bool|0,0|NULL|NULL|
@ -80,14 +79,12 @@ backtrace_min_messages|enum|debug,debug5,debug4,debug3,debug2,debug1,log,info,no
bbox_dump_count|int|1,20|NULL|NULL|
bbox_dump_path|string|0,0|NULL|NULL|
behavior_compat_options|string|0,0|NULL|NULL|
best_agg_plan|int|0,3|NULL|NULL|
bgwriter_delay|int|10,10000|ms|NULL|
bgwriter_lru_maxpages|int|0,1000|NULL|NULL|
bgwriter_lru_multiplier|real|0,10|NULL|NULL|
bgwriter_thread_num|int|0,8|NULL|NULL|
bulk_read_ring_size|int|256,2147483647|kB|NULL|
bulk_write_ring_size|int|16384,2147483647|kB|NULL|
bypass_workload_manager|bool|0,0|NULL|NULL|
bytea_output|enum|escape,hex|NULL|NULL|
cache_connection|bool|0,0|NULL|NULL|
candidate_buf_percent_target|real|0.1,0.85|NULL|NULL|
@ -100,15 +97,11 @@ checkpoint_warning|int|0,2147483647|s|NULL|
check_implicit_conversions|bool|0,0|NULL|NULL|
client_encoding|string|0,0|NULL|It is not recommended to set this parameter in postgresql.conf and it will not take effect even if it is set in postgresql.conf.|
client_min_messages|enum|debug,debug5,debug4,debug3,debug2,debug1,log,info,notice,warning,error,fatal,panic|NULL|When client_min_messages and log_min_messages take the same value, the value represented by the different levels.|
comm_ackchk_time|int|0,20000|NULL|NULL|
comm_cn_dn_logic_conn|bool|0,0|NULL|When comm_cn_dn_logic_conn set to on, CN use logic connection with DN.|
comm_ackchk_time|int|0,20000|ms|NULL|
cn_send_buffer_size|int|8,128|kB|NULL|
comm_client_bind|bool|0,0|NULL|NULL|
comm_control_port|int|0,65535|NULL|NULL|
comm_debug_mode|bool|0,0|NULL|When comm_debug_mode set to on, printing large amount of log, and it will add extra overhead, reduce database performance. Please Open it only when debugging.|
comm_max_datanode|int|1,65535|NULL|NULL|
comm_max_receiver|int|1,50|NULL|NULL|
comm_max_stream|int|1,60000|NULL|NULL|
comm_no_delay|bool|0,0|NULL|NULL|
comm_quota_size|int|0,2048000|kB|NULL|
comm_sctp_port|int|0,65535|NULL|NULL|
@ -155,12 +148,9 @@ dynamic_library_path|string|0,0|NULL|NULL|
dynamic_memory_quota|int|1,100|NULL|NULL|
effective_cache_size|int|1,2147483647|kB|This parameter has no effect on GaussDB Kernel allocated shared memory size, it does not use the kernel disk buffer, it is only used to estimate. The values are used to calculate the disk page, each page is usually 8192 bytes. Higher than the default value may result in the use of index scans, lower values may result in the selection order of scan.|
effective_io_concurrency|int|0,1000|NULL|NULL|
enable_acceleration_cluster_wlm|bool|0,0|NULL|NULL|
enable_access_server_directory|bool|0,0|NULL|NULL|
enable_agg_pushdown_for_ca|bool|0,0|NULL|NULL|
enable_alarm|bool|0,0|NULL|NULL|
enable_analyze_check|bool|0,0|NULL|NULL|
enable_backend_control|bool|0,0|NULL|NULL|
enable_bbox_dump|bool|0,0|NULL|NULL|
enable_ffic_log|bool|0,0|NULL|NULL|
enable_bitmapscan|bool|0,0|NULL|NULL|
@ -173,40 +163,29 @@ enable_instr_rt_percentile|bool|0,0|NULL|NULL|
enable_instr_track_wait|bool|0,0|NULL|NULL|
enable_broadcast|bool|0,0|NULL|NULL|
enable_cbm_tracking|bool|0,0|NULL|Turn on cbm tracking function.|
enable_cgroup_switch|bool|0,0|NULL|NULL|
enable_change_hjcost|bool|0,0|NULL|NULL|
enable_cluster_resize|bool|0,0|NULL|NULL|
enable_copy_server_files|bool|0,0|NULL|NULL|
enable_sonic_hashjoin|bool|0,0|NULL|NULL|
enable_sonic_hashagg|bool|0,0|NULL|NULL|
enable_sonic_optspill|bool|0,0|NULL|NULL|
enable_codegen|bool|0,0|NULL|NULL|
enable_codegen_print|bool|0,0|NULL|Enable dump for llvm function|
enable_full_encryption|bool|0,0|NULL|NULL|
enable_delta_store|bool|0,0|NULL|NULL|
enable_default_cfunc_libpath|bool|0,0|NULL|NULL|
codegen_cost_threshold|int|0,2147483647|NULL|Decided to use LLVM optimization or not|
codegen_strategy|enum|partial,pure|NULL|NULL|
enable_compress_spill|bool|0,0|NULL|NULL|
enable_constraint_optimization|bool|0,0|NULL|Information Constrained Optimization is only limited to the HDFS foreign table. When you execute a query which does not contain HDFS foreign table, the parameter is set to off.|
enable_control_group|bool|0,0|NULL|NULL|
enable_csqual_pushdown|bool|0,0|NULL|NULL|
enable_data_replicate|bool|0,0|NULL|When this parameter is set on, replication_type must be 0.|
enable_mix_replication|bool|0,0|NULL|NULL|
enable_dynamic_workload|bool|0,0|NULL|NULL|
enable_instance_metric_persistent|bool|0,0|NULL|NULL|
enable_logical_io_statistics|bool|0,0|NULL|NULL|
instance_metric_retention_time|int|0,3650|day|NULL|
enable_dywlm_adjust|bool|0,0|NULL|NULL|
enable_fast_query_shipping|bool|0,0|NULL|NULL|
enable_compress_hll|bool|0,0|NULL|NULL|
enable_fast_numeric|bool|0,0|NULL|Enable numeric optimize.|
enable_force_memory_control|bool|0,0|NULL|NULL|
enable_force_reuse_connections|bool|0,0|NULL|NULL|
enable_force_vector_engine|bool|0,0|NULL|NULL|
enable_fstream|bool|0,0|NULL|NULL|
enable_global_plancache|bool|0,0|NULL|NULL|
enable_gtm_free|bool|0,0|NULL|NULL|
enable_twophase_commit|bool|0,0|NULL|NULL|
enable_hashagg|bool|0,0|NULL|NULL|
enable_hashjoin|bool|0,0|NULL|NULL|
@ -251,12 +230,12 @@ enable_save_datachanged_timestamp|bool|0,0|NULL|NULL|
enable_seqscan|bool|0,0|NULL|NULL|
enable_show_any_tuples|bool|0,0|NULL|NULL|
enable_sort|bool|0,0|NULL|NULL|
enable_stream_operator|bool|0,0|NULL|NULL|
enable_unshipping_log|bool|0,0|NULL|NULL|
enable_stream_concurrent_update|bool|0,0|NULL|NULL|
enable_stream_recursive|bool|0,0|NULL|NULL|
enable_incremental_catchup|bool|0,0|NULL|NULL|
wait_dummy_time|int|0,2147483647|NULL|NULL|
max_active_global_temporary_table|int|0,1000000|NULL|NULL|
max_recursive_times|int|0,2147483647|NULL|NULL|
enable_tidscan|bool|0,0|NULL|NULL|
enable_transaction_parctl|bool|0,0|NULL|NULL|
@ -416,10 +395,9 @@ max_user_defined_exception|int|1000,1000|NULL|NULL|
max_wal_senders|int|0,262143|NULL|Check whether the new value of max_wal_senders is less than max_connections and wal_level is archive or hot_standby, otherwise the gaussdb will start failed.|
max_redo_log_size|int|163840,2147483647|kB|NULL|
memorypool_enable|bool|0,0|NULL|NULL|
memory_fault_percent|int|0,2147483647|NULL|NULL|
memorypool_size|int|131072,1073741823|kB|NULL|
memory_detail_tracking|string|0,0|NULL|This parameter memory_detail_tracking only can be used in debug version. If it is set in the release version, it will lead the cluster does not work properly. Therefore, before making the settings, please make sure that the cluster version is debug.|
memory_tracking_mode|enum|none,normal,executor|NULL|NULL|
memory_tracking_mode|enum|none,normal,executor,fullexec|NULL|NULL|
minimum_pool_size|int|1,65535|NULL|NULL|
modify_initial_password|bool|0,0|NULL|NULL|
most_available_sync|bool|0,0|NULL|NULL|
@ -518,9 +496,9 @@ syslog_facility|enum|local0,local1,local2,local3,local4,local5,local6,local7|NUL
syslog_ident|string|0,0|NULL|NULL|
table_skewness_warning_rows|int|0,2147483647|NULL|NULL|
table_skewness_warning_threshold|real|0,1|NULL|NULL|
tcp_keepalives_count|int|0,2147483647|NULL|NULL|
tcp_keepalives_idle|int|0,2147483647|s|If the operating system does not support TCP_KEEPIDLE option, the value of this parameter must be zero. On the operating system via a Unix domain socket connection, this parameter will be ignored.|
tcp_keepalives_interval|int|0,2147483647|s|If the operating system does not support TCP_KEEPIDLE option, the value of this parameter must be 1. On the operating system via a Unix domain socket connection, this parameter will be ignored.|
tcp_keepalives_count|int|0,100|NULL|NULL|
tcp_keepalives_idle|int|0,3600|s|If the operating system does not support TCP_KEEPIDLE option, the value of this parameter must be zero. On the operating system via a Unix domain socket connection, this parameter will be ignored.|
tcp_keepalives_interval|int|0,180|s|If the operating system does not support TCP_KEEPIDLE option, the value of this parameter must be 1. On the operating system via a Unix domain socket connection, this parameter will be ignored.|
temp_buffers|int|100,1073741823|kB|NULL|
temp_file_limit|int|-1,2147483647|kB|SQL query using a temporary table space when executed unless the system.|
temp_tablespaces|string|0,0|NULL|NULL|
@ -538,7 +516,7 @@ track_thread_wait_status_interval|int|0,1440|min|NULL|
track_sql_count|bool|0,0|NULL|NULL|
transaction_deferrable|bool|0,0|NULL|NULL|
transaction_isolation|string|0,0|NULL|NULL|
transaction_pending_time|int|-1,2147483647|NULL|NULL|
transaction_pending_time|int|-1,1073741823|NULL|NULL|
transaction_read_only|bool|0,0|NULL|NULL|
transparent_encrypted_string|string|0,0|NULL|NULL|
transparent_encrypt_kms_url|string|0,0|NULL|NULL|
@ -632,12 +610,10 @@ udfworkermemhardlimit|int|0,2147483647|kB|Sets the hard memory limit to be used
pljava_vmoptions|string|0,0|NULL|VMOptions to start the JVM in pljava when it is created.|
enable_extrapolation_stats|bool|0,0|NULL|NULL|
retry_ecode_list|string|0,0|NULL|NULL|
enable_tsdb|bool|0,0|NULL|NULL|
enable_ts_compaction|bool|0,0|NULL|NULL|
ts_consumer_workers|int|1,100|NULL|NULL|
ts_compaction_strategy|string|0,0|NULL|NULL|
ts_adaptive_threads|bool|0,0|NULL|NULL|
enable_streaming|bool|0,0|NULL|NULL|
streaming_router_port|int|0,65535|NULL|Streaming router port. Please keep the value (streaming_router_port - port) not change.|
streaming_gather_window_interval|int|5,1440|NULL|NULL|
streaming_num_workers|int|1,64|NULL|NULL|
@ -674,49 +650,12 @@ enable_auto_explain|bool|0,0|NULL|NULL|
auto_explain_level|enum|off,log,notice|NULL|NULL|
cost_weight_index|real|1e-10,1e+10|NULL|NULL|
default_limit_rows|real|-100,1.79769e+308|NULL|NULL|
enable_hotkeys_collection|bool|0,0|NULL|NULL|
sql_beta_feature|enum|sel_semi_poisson,sel_expr_instr,param_path_gen,rand_cost_opt,param_path_opt,page_est_opt,none|NULL|NULL|
catchup2normal_wait_time|int|-1,10000|ms|The maximal allowed duration for waiting from catchup to normal state.|
max_concurrent_autonomous_transactions|int|0,262143|NULL|NULL|
sync_config_strategy|enum|all_node,only_sync_node,none_node|NULL|Synchronization strategy for configuration files between host and standby.|
time_to_target_rpo|int|0,3600|NULL|NULL|
disable_memory_protect|bool|0,0|NULL|NULL|
[gtm]
nodename|string|0,0|NULL|Name of this GTM/GTM-Standby.|
port|int|1,65535|NULL|Listen Port of GTM or GTM standby server.|
log_file|int|1,65535|NULL|NULL|
active_host|string|0,0|NULL|Address of target GTM ACT.|
local_host|string|0,0|NULL|HA Local Host.|
active_port|int|1,65535|NULL|GTM server port number when it works as GTM-Standby.|
local_port|int|1,65535|NULL|HA Local Port.|
standby_connection_timeout|int|5,2147483647|NULL|Connection timeout between GTM and GTM-Standby.|
keepalives_count|int|0,2147483647|NULL|Sets keepalives_count option to the connection to GTM.|
keepalives_idle|int|0,2147483647|s|Sets keepalives_idle option for the connection to GTM.|
keepalives_interval|int|0,2147483647|s|Sets keepalives_interval option fo the connetion to GTM.|
synchronous_backup|enum|off,on,auto|NULL|Specifies if backup to GTM-Standby is taken in synchronous manner.|
query_memory_limit|real|0,1|NULL|Sets the percentage limit of memory a query can use.|
wlm_max_mem|int|1,2147483646|MB|Sets the maximum memory an instance can use for its executions.(unit: MB)|
config_file|string|0,0|NULL|Configuration file name.|
data_dir|string|0,0|NULL|Work directory.|
gtm_host|string|0,0|NULL|Address of target GTM ACT.|
gtm_port|int|1,65535|NULL|GTM server port number.|
listen_addresses|string|0,0|NULL|Listen address.|
log_directory|string|0,0|NULL|Sets the destination directory for log files.|
log_min_messages|enum|debug5,debug1,log,warning,error,fatal|NULL|Minimum message level to write to the log file.|
alarm_component|string|0,0|NULL|Sets the component for alarm function.|
alarm_report_interval|int|0,2147483647|NULL|Sets the interval time between two alarm report.|
enable_alarm|bool|0,0|NULL|enable alarm or not.|
enable_connect_control|bool|0,0|NULL|enable to control connection by checking IPs.|
standby_only|int|0,1|NULL|enable sync to standby.|
gtm_max_trans|int|256,200000|NULL|Sets the max global transaction number.|
gtm_enable_threadpool|bool|0,0|NULL|Enable GTM thread pool.|
gtm_num_threads|int|0,16384|NULL|Sets GTM worker thread number.|
gtm_authentication_type|enum|trust,gss|NULL|NULL|
gtm_krb_server_keyfile|string|0,0|NULL|NULL|
distribute_test_param|string|0,0|NULL|NULL|
gtm_option|int|0,2|NULL|NULL|
restore_duration|int|1000000,2147483647|NULL|NULL|
csn_sync_interval|int|1,2147483647|NULL|NULL|
[cmserver]
log_dir|string|0,0|NULL|NULL|
log_file_size|int|0,2047|MB|NULL|
@ -794,7 +733,6 @@ autovacuum_analyze_scale_factor|real|0,100|NULL|NULL|
autovacuum_analyze_threshold|int|0,2147483647|NULL|NULL|
autovacuum_vacuum_scale_factor|real|0,100|NULL|NULL|
autovacuum_vacuum_threshold|int|0,2147483647|NULL|NULL|
enable_stream_operator|bool|0,0|NULL|NULL|
enable_data_replicate|bool|0,0|NULL|When this parameter is set on, replication_type must be 0.|
wal_keep_segments|int|2,2147483647|NULL|When the server is turned on or archive log recovery from the checkpoint, the number of reserved log files may be larger than the set value wal_keep_segments. If this parameter is set too low, at the time of the transaction log backup requests, the new transaction log may have been produced coverage request fails, disconnect the master and slave relationship.|
wal_sender_timeout|int|0,2147483647|ms|If the host larger data rebuild operation requires increasing the value of this parameter,the host data at 500G, refer to this parameter is 600. This value can not be greater than the wal_receiver_timeout or database rebuilding timeout parameter.|

700
src/bin/gs_guc/cluster_guc.cpp Executable file → Normal file
View File

@ -16,7 +16,7 @@
*
* cluster_guc.cpp
* Interfaces for analysis manager of PDK tool.
*
*
* Function List: execute_guc_command_in_remote_node
* form_commandline_options
* get_instance_type
@ -36,7 +36,6 @@
#include "common/config/cm_config.h"
#include <limits.h>
#include <fcntl.h>
#include <math.h>
const int CLUSTER_CONFIG_SUCCESS = 0;
const int CLUSTER_CONFIG_ERROR = 1;
@ -179,23 +178,6 @@ const int MB_PER_GB = 1024;
#define MIN_PER_D (60 * 24)
#define H_PER_D 24
/* the number of the unit type */
const int UNIT_TYPE = 8;
/*
* transform unit matrix
* Elements in each line represent the transform value between this unit and another unit when a unit is basic unit.
*/
const int g_unit_transform[UNIT_TYPE][UNIT_TYPE] = {
{1, KB_PER_MB, KB_PER_GB, 0, 0, 0, 0, 0}, /* the transform value based on KB */
{0, 1, MB_PER_GB, 0, 0, 0, 0, 0}, /* the transform value based on MB */
{0, 0, 1, 0, 0, 0, 0, 0}, /* the transform value based on GB */
{0, 0, 0, 1, MS_PER_S, MS_PER_MIN, MS_PER_H, MS_PER_D}, /* the transform value based on ms */
{0, 0, 0, 0, 1, S_PER_MIN, S_PER_H, S_PER_D}, /* the transform value based on s */
{0, 0, 0, 0, 0, 1, MIN_PER_H, MIN_PER_D}, /* the transform value based on min */
{0, 0, 0, 0, 0, 0, 1, H_PER_D}, /* the transform value based on h */
{0, 0, 0, 0, 0, 0, 0, 1} /* the transform value based on d */
};
/* execute result */
#define SUCCESS 0
#define FAILURE 1
@ -216,7 +198,7 @@ bool is_disable_log_directory = false;
typedef enum { GUC_ERROR = -1, GUC_NAME, GUC_TYPE, GUC_VALUE, GUC_MESG } OptType;
/* type about all guc unit */
/*
/*
*********************************************
parameters value support units
*********************************************
@ -268,6 +250,15 @@ const char* guc_bool_valuelist[] = {
"1",
};
/* value type list */
const char *value_type_list[] = {
"boolean",
"enum",
"integer",
"real",
"string",
};
/* value about the parameters which unit is 8kB */
const char* unit_eight_kB_parameter_list[] = {
"backwrite_quantity",
@ -288,10 +279,7 @@ void get_instance_configfile(const char* datadir);
char* get_ctl_command_type();
void* pg_malloc(size_t size);
void* pg_malloc_zero(size_t size);
template <typename T>
static int parse_value(
const char* paraname, const UnitType unitval, const UnitType new_unitval, const char* endptr, T* tmp_val);
#ifdef __cplusplus
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@ -347,12 +335,8 @@ int check_parameter_value(
const char* paraname, GucParaType type, char* guc_list_value, const char* guc_list_unit, const char* value);
int check_parameter_name(char** guc_opt, int type);
bool check_parameter_is_valid(int type);
static int check_int_overflow(
const char* paraname, const UnitType unitval, const UnitType tmp_unitval, int64 tmp_int_val);
static int check_double_overflow(
const char* paraname, const double val, const bool inf_is_valid, const bool zero_is_valid);
int parse_int_value(const char* paraname, const char* value, const char* guc_list_unit, int64* result_int);
int parse_double_value(const char* paraname, const char* value, const char* guc_list_unit, double* result_double);
int parse_value(const char* paraname, const char* value, const char* guc_list_unit, int64* result_int,
double* result_double, bool isInt);
int get_guc_minmax_value(const char* guc_list_val, struct guc_minmax_value& value_list);
int check_int_real_type_value(
const char* paraname, const char* guc_list_value, const char* guc_list_unit, const char* value, bool isInt);
@ -1758,6 +1742,128 @@ int get_nodename_number_from_nodelist(const char* namelist)
return count;
}
/*
******************************************************************************
******************************************************************************
Function : check_datanodename_value
Description : check the input datanode Name.
Input :nodeName data node name
return :true input datanode name is correct
false input datanode name is incorrect
******************************************************************************
*/
bool CheckDataNameValue(const char *datanodeName, const char *dataDir)
{
int nRet;
uint32 nodeIdx = 0;
uint32 datanodeIdx = 0;
int dnIdMaxLen = 64;
char dnId[dnIdMaxLen];
if ((datanodeName == NULL) || (*datanodeName == '\0')) {
return false;
}
dataNodeInfo *dnI = NULL;
for (datanodeIdx = 0; datanodeIdx < g_currentNode->datanodeCount; datanodeIdx++) {
dataNodeInfo *dniTmp = &(g_currentNode->datanode[datanodeIdx]);
if (strcmp(dniTmp->datanodeLocalDataPath, dataDir) == 0) {
dnI = dniTmp;
break;
}
}
if (dnI == NULL) {
write_stderr("Failed: cannot find the expected data dir\n");
return false;
}
for (nodeIdx = 0; nodeIdx < g_node_num; ++nodeIdx) {
staticNodeConfig *dest = &(g_node[nodeIdx]);
for (datanodeIdx = 0; datanodeIdx < dest->datanodeCount; ++datanodeIdx) {
dataNodeInfo *dn = &(dest->datanode[datanodeIdx]);
if (dn->datanodeId == 0 || dn->datanodeId == dnI->datanodeId) {
continue;
}
nRet = memset_s(dnId, sizeof(dnId), '\0', sizeof(dnId));
securec_check_c(nRet, "\0", "\0");
nRet = snprintf_s(
dnId, sizeof(dnId) / sizeof(char), sizeof(dnId) / sizeof(char) - 1, "dn_%4d", dn->datanodeId);
securec_check_ss_c(nRet, "\0", "\0");
if (strncmp(dnId, datanodeName,
((strlen(dnId) > strlen(datanodeName)) ? strlen(dnId) : strlen(datanodeName))) != 0) {
continue;
}
for (int peerIndex = 0; peerIndex < CM_MAX_DATANODE_STANDBY_NUM; ++peerIndex) {
peerDatanodeInfo *peerDatanode = &(dnI->peerDatanodes[peerIndex]);
if (strlen(peerDatanode->datanodePeerHAIP[0]) == 0) {
continue;
}
if (strcmp(peerDatanode->datanodePeerHAIP[0], dn->datanodeLocalHAIP[0]) == 0 &&
peerDatanode->datanodePeerHAPort == dn->datanodeLocalHAPort) {
return true;
}
}
}
}
return false;
}
/*
******************************************************************************
Function : parse_datanodename_result
Description : check data node name.
Input :datanodenamelist data node name
return :NULL input data node name is incorrect
other the real result
******************************************************************************
*/
char *ParseDatanameResult(const char *datanodeNameList, const char *dataDir)
{
int nRet;
char *vptr = NULL;
char *vouterPtr = NULL;
char *p = NULL;
char delims[] = ",";
char tmp[MAX_VALUE_LEN] = {0};
char *buffer = NULL;
size_t len;
// init tmp nodeName string, array which storage nodeName string
nRet = memset_s(tmp, MAX_VALUE_LEN, '\0', MAX_VALUE_LEN);
securec_check_c(nRet, "\0", "\0");
nRet = snprintf_s(tmp, MAX_VALUE_LEN, MAX_VALUE_LEN - 1, "%s", datanodeNameList);
securec_check_ss_c(nRet, "\0", "\0");
// split the node name by ','
vptr = strtok_r(tmp, delims, &vouterPtr);
while (vptr != NULL) {
p = vptr;
// p like this: dn_6001, dn_6002
while (isspace((unsigned char)*p)) {
p++;
}
if (CheckDataNameValue(p, dataDir)) {
// do split again
vptr = strtok_r(NULL, delims, &vouterPtr);
} else {
// input node name is incorrect
write_stderr("Notice: datanodename value check failed.(datanodename=%s)\n", p);
return NULL;
}
}
len = strlen(datanodeNameList) + 1;
// get the string information
buffer = (char *)pg_malloc_zero(len * sizeof(char));
nRet = snprintf_s(buffer, len, (len - 1), "%s", datanodeNameList);
securec_check_ss_c(nRet, buffer, "\0");
return buffer;
}
/*
******************************************************************************
Function : get_AZ_value
@ -1786,6 +1892,7 @@ char* get_AZ_value(const char* value, const char* data_dir)
char delims[] = ",";
char* vptr = NULL;
char emptyvalue[] = "''";
bool isNodeName = false;
if (az1 != NULL) {
minLen = strlen("ANY X()") + strlen(az1);
@ -1849,6 +1956,14 @@ char* get_AZ_value(const char* value, const char* data_dir)
while (isspace((unsigned char)*p))
p++;
if (strncmp(p, "NODE ", strlen("NODE ")) == 0) {
isNodeName = true;
p = p + strlen("NODE ");
while (isspace((unsigned char)*p)) {
p++;
}
}
/* make sure it is digit and between 1 and 7, including 1 and 7 */
if (!isdigit((unsigned char)*p)) {
goto failed;
@ -1870,7 +1985,7 @@ char* get_AZ_value(const char* value, const char* data_dir)
while (isspace((unsigned char)*p))
p++;
/*p like this: (AZ1,AZ2,..) */
/* p like this: (AZ1,AZ2,..) or (dn_6001, dn_6002) */
if ('(' != (unsigned char)*p) {
goto failed;
}
@ -1899,8 +2014,14 @@ char* get_AZ_value(const char* value, const char* data_dir)
goto failed;
}
// parse and check the AZName string
nodenameList = parse_AZ_result(q, data_dir);
if (isNodeName) {
// parse and check nodeName string
nodenameList = ParseDatanameResult(q, data_dir);
} else {
// parse and check the AZName string
nodenameList = parse_AZ_result(q, data_dir);
}
if (NULL == nodenameList) {
// try dn
nodenameList = get_nodename_list_by_AZ(az1, data_dir);
@ -1914,7 +2035,7 @@ char* get_AZ_value(const char* value, const char* data_dir)
// p like this: dn_6001, dn_6002...
while (isspace((unsigned char)*p))
p++;
if (strstr(nodenameList, p) == NULL) {
goto failed;
}
@ -1923,7 +2044,7 @@ char* get_AZ_value(const char* value, const char* data_dir)
len = strlen(nodenameList);
nRet = snprintf_s(nodenameList, len + 1, len, "%s", q);
} else if ('\0' == nodenameList[0]) {
(void)write_stderr("ERROR: There is no standby node name. Please make sure the value of "
"synchronous_standby_names is correct.\n");
@ -1934,7 +2055,7 @@ char* get_AZ_value(const char* value, const char* data_dir)
count = get_nodename_number_from_nodelist(nodenameList);
if (atoi(level) > count) {
(void)write_stderr("ERROR: The sync number(%d) must less or equals to the number of standby node names(%d). "
"Please make sure the value of synchronous_standby_names is correct.\n",
"Please make sure the value of synchronous_standby_names is correct.\n",
atoi(level), count);
GS_FREE(nodenameList);
return NULL;
@ -2161,20 +2282,17 @@ void do_command_for_dn(int type, char* indatadir)
errno_t rc = 0;
for (i = 0; i < get_local_num_datanode(); i++) {
if (i < g_currentNode->datanodeCount) {
rc = memcpy_s(temp_datadir, sizeof(temp_datadir) / sizeof(char), g_currentNode->datanode[i].datanodeLocalDataPath, sizeof(temp_datadir) / sizeof(char));
securec_check_c(rc, "\0", "\0");
}
rc = memcpy_s(temp_datadir, sizeof(temp_datadir) / sizeof(char), g_currentNode->datanode[i].datanodeLocalDataPath, sizeof(temp_datadir) / sizeof(char));
securec_check_c(rc, "\0", "\0");
save_expect_instance_info(temp_datadir);
}
for (i = 0; i < get_local_num_datanode(); i++) {
if (i < g_currentNode->datanodeCount) {
rc = memcpy_s(temp_datadir, sizeof(temp_datadir) / sizeof(char), g_currentNode->datanode[i].datanodeLocalDataPath, sizeof(temp_datadir) / sizeof(char));
securec_check_c(rc, "\0", "\0");
}
if (FAILURE == do_local_guc_command(type, temp_datadir))
rc = memcpy_s(temp_datadir, sizeof(temp_datadir) / sizeof(char), g_currentNode->datanode[i].datanodeLocalDataPath, sizeof(temp_datadir) / sizeof(char));
securec_check_c(rc, "\0", "\0");
if (FAILURE == do_local_guc_command(type, temp_datadir)) {
return;
}
}
}
@ -2445,7 +2563,7 @@ static void init_global_command()
'\0',
g_max_commands_parallel * sizeof(PARALLEL_COMMAND_S));
securec_check_c(rc, "\0", "\0");
g_cur_commands_parallel = 0;
for (i = 0; i < g_max_commands_parallel; i++) {
curr_cxt = &g_parallel_command_cxt[i];
@ -2597,7 +2715,7 @@ static void executePopenCommandsParallel(const char* cmd, int idx, bool is_local
curr_cxt->pfp = popen(fcmd, "r");
GS_FREE(fcmd);
GS_FREE(mpprvFile);
if (NULL != curr_cxt->pfp) {
g_cur_commands_parallel++;
uint32 flags;
@ -3493,7 +3611,7 @@ bool check_cn_dn_parameter_is_valid()
all_valid = false;
} else if (strncmp(tmp, "enableseparationofduty", strlen("enableseparationofduty")) == 0) {
/* for enableSeparationOfDuty, we give warning */
(void)write_stderr("WARNING: please take care of the actual privileges of the users "
(void)write_stderr("WARNING: please take care of the actual privileges of the users "
"while changing enableSeparationOfDuty.\n");
}
#ifndef USE_ASSERT_CHECKING
@ -3697,7 +3815,7 @@ bool is_parameter_value_error(const char* guc_opt_str, char* config_value_str, c
if (guc_variable_list.type == GUC_PARA_ENUM) {
ch_position = strchr(config_value_str,',');
if (ch_position != NULL) {
if (ch_position != NULL) {
if (!((config_value_str[0] == '\'' || config_value_str[0] == '"') &&
config_value_str[0] == config_value_str[len - 1])) {
(void)write_stderr("ERROR: The value \"%s\" for parameter \"%s\" is incorrect. Please do it like this "
@ -3706,7 +3824,7 @@ bool is_parameter_value_error(const char* guc_opt_str, char* config_value_str, c
config_param_str);
exit(1);
}
}
}
}
if (guc_variable_list.type == GUC_PARA_INT || guc_variable_list.type == GUC_PARA_REAL ||
@ -3740,8 +3858,15 @@ bool is_parameter_value_error(const char* guc_opt_str, char* config_value_str, c
guc_variable_list.guc_unit,
newvalue)) {
is_failed = true;
(void)write_stderr(
"ERROR: The value \"%s\" for parameter \"%s\" is incorrect.\n", config_value_str, config_param_str);
if (guc_variable_list.type >= 0 &&
guc_variable_list.type < (GucParaType)(sizeof(value_type_list) / sizeof(value_type_list[0]))) {
(void) write_stderr("ERROR: The value \"%s\" for parameter \"%s\" is incorrect, requires a %s value\n",
config_value_str, config_param_str, value_type_list[guc_variable_list.type]);
} else {
(void) write_stderr("ERROR: The value \"%s\" for parameter \"%s\" is incorrect.\n", config_value_str,
config_param_str);
}
}
}
@ -3949,8 +4074,8 @@ int check_int_value(const char* paraname, const struct guc_minmax_value& value_l
bool is_in_list = false;
bool is_exists_alpha = false;
/* makesure the min/max value from guc config list file is correct */
if ((FAILURE == parse_int_value(paraname, value_list.min_val_str, NULL, &int_min_val)) ||
(FAILURE == parse_int_value(paraname, value_list.max_val_str, NULL, &int_max_val))) {
if ((FAILURE == parse_value(paraname, value_list.min_val_str, NULL, &int_min_val, NULL, true)) ||
(FAILURE == parse_value(paraname, value_list.max_val_str, NULL, &int_max_val, NULL, true))) {
(void)write_stderr("ERROR: The minmax value of parameter \"%s\" requires an integer value.\n", paraname);
return FAILURE;
}
@ -4007,8 +4132,8 @@ int check_real_value(const char* paraname, const struct guc_minmax_value& value_
double double_min_val, double double_max_val)
{
/* makesure the min/max value from guc config list file is correct */
if ((FAILURE == parse_double_value(paraname, value_list.min_val_str, NULL, &double_min_val)) ||
(FAILURE == parse_double_value(paraname, value_list.max_val_str, NULL, &double_max_val))) {
if ((FAILURE == parse_value(paraname, value_list.min_val_str, NULL, NULL, &double_min_val, false)) ||
(FAILURE == parse_value(paraname, value_list.max_val_str, NULL, NULL, &double_max_val, false))) {
(void)write_stderr("ERROR: The minmax value of parameter \"%s\" requires a numeric value.\n", paraname);
return FAILURE;
}
@ -4056,16 +4181,12 @@ int check_int_real_type_value(
securec_check_c(nRet, "\0", "\0");
/* parse int_newval/double_newval value*/
if (isInt) {
if (FAILURE == parse_int_value(paraname, value, guc_list_unit, &int_newval)) {
if (FAILURE == parse_value(paraname, value, guc_list_unit, &int_newval, &double_newval, isInt)) {
if (isInt)
(void)write_stderr("ERROR: The parameter \"%s\" requires an integer value.\n", paraname);
return FAILURE;
}
} else {
if (FAILURE == parse_double_value(paraname, value, guc_list_unit, &double_newval)) {
else
(void)write_stderr("ERROR: The parameter \"%s\" requires a numeric value.\n", paraname);
return FAILURE;
}
return FAILURE;
}
/* get min/max value from guc config file */
@ -4085,168 +4206,48 @@ int check_int_real_type_value(
/*
************************************************************************************
Function: check_int_overflow
Desc : check to see if a int val has underflowed or overflowed for parameter.
paraname parameter name
unitval the unit of parameter from guc config file
new_unitval the unit of parameter
new_int_val the value of parameter
Return : SUCCESS
FAILURE
************************************************************************************
*/
static int check_int_overflow(
const char* paraname, const UnitType unitval, const UnitType new_unitval, int64 new_int_val)
{
int per_unit_transfer = INT_MIN;
/* the transformation value */
per_unit_transfer = g_unit_transform[unitval][new_unitval];
if (new_int_val > (LLONG_MAX / per_unit_transfer) || new_int_val < (LLONG_MIN / per_unit_transfer)) {
(void)write_stderr("ERROR: An overflow occurs for this parameter \"%s\".\n", paraname);
return FAILURE;
}
return SUCCESS;
}
/*
************************************************************************************
Function: check_double_overflow
Desc : check to see if a double val has underflowed or overflowed for parameter.
paraname parameter name
val the value of parameter after calculation
inf_is_valid infinity is valid
zero_is_valid zero is valid
Return : SUCCESS
FAILURE
************************************************************************************
*/
static int check_double_overflow(
const char* paraname, const double val, const bool inf_is_valid, const bool zero_is_valid)
{
if (isinf(val) && !(inf_is_valid)) {
(void)write_stderr("ERROR: An overflow occurs for this parameter \"%s\".\n", paraname);
return FAILURE;
}
if ((val) == 0.0 && !(zero_is_valid)) {
(void)write_stderr("ERROR: An overflow occurs for this parameter \"%s\".\n", paraname);
return FAILURE;
}
return SUCCESS;
}
/*
************************************************************************************
Function: parse_int_value
Desc : parese int value from guc config file.
Function: parse_value
Desc : parese value from guc config file.
paraname parameter name
value parameter value
guc_list_unit the unit of parameter from guc config file
result_int the parse result about int
result_double the parse result about double
isInt true is int, false is real
Return : SUCCESS
FAILURE
************************************************************************************
*/
int parse_int_value(const char* paraname, const char* value, const char* guc_list_unit, int64* result_int)
int parse_value(const char* paraname, const char* value, const char* guc_list_unit, int64* result_int,
double* result_double, bool isInt)
{
int64 int_val = INT_MIN;
int64 tmp_int_val;
char* endptr = NULL;
bool contain_space = false;
UnitType int_unitval = UNIT_ERROR;
UnitType new_int_unitval = UNIT_ERROR;
if (NULL != result_int) {
*result_int = 0;
}
errno = 0;
/* transform value into long int */
int_val = strtoll(value, &endptr, 0);
if (endptr == value || errno == ERANGE) {
return FAILURE;
}
tmp_int_val = int_val;
/* skill the blank */
while (isspace((unsigned char)*endptr)) {
endptr++;
contain_space = true;
}
if ('\0' != *endptr) {
/* if unit is NULL, it means the value is incorrect */
if (NULL == guc_list_unit || '\0' == guc_list_unit[0]) {
return FAILURE;
}
if (contain_space) {
(void)write_stderr("ERROR: There should not hava space between value and unit.\n");
return FAILURE;
}
/* the unit of parameter from guc config file */
int_unitval = get_guc_unit(guc_list_unit);
/* the unit of real parameter */
new_int_unitval = get_guc_unit(endptr);
/* get_guc_unit */
if (FAILURE == parse_value(paraname, int_unitval, new_int_unitval, endptr, &int_val)) {
return FAILURE;
}
/* overflow processing */
if (FAILURE == check_int_overflow(paraname, int_unitval, new_int_unitval, tmp_int_val)) {
return FAILURE;
}
}
if (NULL != result_int) {
*result_int = int_val;
}
return SUCCESS;
}
/*
************************************************************************************
Function: parse_double_value
Desc : parese double value from guc config file.
paraname parameter name
value parameter value
guc_list_unit the unit of parameter from guc config file
result_double the parse result about double
Return : SUCCESS
FAILURE
************************************************************************************
*/
int parse_double_value(const char* paraname, const char* value, const char* guc_list_unit, double* result_double)
{
double double_val;
double tmp_double_val;
long double tmp_double_val;
char* endptr = NULL;
UnitType unitval = UNIT_ERROR;
bool contain_space = false;
UnitType double_unitval = UNIT_ERROR;
UnitType new_double_unitval = UNIT_ERROR;
int per_unit_transfer = INT_MIN;
if (NULL != result_double) {
if (NULL != result_int)
*result_int = 0;
if (NULL != result_double)
*result_double = 0;
}
errno = 0;
/* transform value into double */
double_val = strtod(value, &endptr);
if (endptr == value || errno == ERANGE) {
return FAILURE;
if (isInt) {
/* transform value into long int */
int_val = strtoll(value, &endptr, 0);
if (endptr == value || errno == ERANGE)
return FAILURE;
tmp_double_val = (long double)int_val;
} else {
/* transform value into double */
double_val = strtod(value, &endptr);
if (endptr == value || errno == ERANGE)
return FAILURE;
tmp_double_val = (long double)double_val;
}
tmp_double_val = double_val;
/* skill the blank */
while (isspace((unsigned char)*endptr)) {
endptr++;
@ -4255,37 +4256,139 @@ int parse_double_value(const char* paraname, const char* value, const char* guc_
if ('\0' != *endptr) {
/* if unit is NULL, it means the value is incorrect */
if (NULL == guc_list_unit || '\0' == guc_list_unit[0]) {
if (NULL == guc_list_unit || '\0' == guc_list_unit[0])
return FAILURE;
}
if (contain_space) {
(void)write_stderr("ERROR: There should not hava space between value and unit.\n");
return FAILURE;
}
/* the unit of parameter from guc config file */
double_unitval = get_guc_unit(guc_list_unit);
/* the unit of real parameter */
new_double_unitval = get_guc_unit(endptr);
/* the transformation value */
per_unit_transfer = g_unit_transform[double_unitval][new_double_unitval];
/* get_guc_unit */
if (FAILURE == parse_value(paraname, double_unitval, new_double_unitval, endptr, &double_val)) {
unitval = get_guc_unit(guc_list_unit);
if (UNIT_ERROR == unitval) {
(void)write_stderr("ERROR: Invalid units for this parameter \"%s\".\n", paraname);
return FAILURE;
} else if (UNIT_KB == unitval) {
if (strncmp(endptr, "kB", 2) == 0) {
endptr += 2;
} else if (strncmp(endptr, "MB", 2) == 0) {
endptr += 2;
tmp_double_val *= KB_PER_MB;
} else if (strncmp(endptr, "GB", 2) == 0) {
endptr += 2;
tmp_double_val *= KB_PER_GB;
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"kB\", \"MB\" and \"GB\".\n", paraname);
return FAILURE;
}
} else if (UNIT_MB == unitval) {
if (strncmp(endptr, "MB", 2) == 0) {
endptr += 2;
} else if (strncmp(endptr, "GB", 2) == 0) {
endptr += 2;
tmp_double_val *= MB_PER_GB;
} else {
(void)write_stderr("ERROR: Valid units for this parameter \"%s\" are \"MB\" and \"GB\".\n", paraname);
return FAILURE;
}
} else if (UNIT_GB == unitval) {
if (strncmp(endptr, "GB", 2) == 0) {
endptr += 2;
} else {
(void)write_stderr("ERROR: Valid units for this parameter \"%s\" is \"GB\".\n", paraname);
return FAILURE;
}
} else if (UNIT_MS == unitval) {
if (strncmp(endptr, "ms", 2) == 0) {
endptr += 2;
} else if (strncmp(endptr, "s", 1) == 0) {
endptr += 1;
tmp_double_val *= MS_PER_S;
} else if (strncmp(endptr, "min", 3) == 0) {
endptr += 3;
tmp_double_val *= MS_PER_MIN;
} else if (strncmp(endptr, "h", 1) == 0) {
endptr += 1;
tmp_double_val *= MS_PER_H;
} else if (strncmp(endptr, "d", 1) == 0) {
endptr += 1;
tmp_double_val *= MS_PER_D;
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"ms\", \"s\", \"min\", \"h\", and \"d\".\n",
paraname);
return FAILURE;
}
} else if (UNIT_S == unitval) {
if (strncmp(endptr, "s", 1) == 0) {
endptr += 1;
} else if (strncmp(endptr, "min", 3) == 0) {
endptr += 3;
tmp_double_val *= S_PER_MIN;
} else if (strncmp(endptr, "h", 1) == 0) {
endptr += 1;
tmp_double_val *= S_PER_H;
} else if (strncmp(endptr, "d", 1) == 0) {
endptr += 1;
tmp_double_val *= S_PER_D;
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"s\", \"min\", \"h\", and \"d\".\n", paraname);
return FAILURE;
}
} else if (UNIT_MIN == unitval) {
if (strncmp(endptr, "min", 3) == 0) {
endptr += 3;
} else if (strncmp(endptr, "h", 1) == 0) {
endptr += 1;
tmp_double_val *= MIN_PER_H;
} else if (strncmp(endptr, "d", 1) == 0) {
endptr += 1;
tmp_double_val *= MIN_PER_D;
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"min\", \"h\", and \"d\".\n", paraname);
return FAILURE;
}
} else if (UNIT_H == unitval) {
if (strncmp(endptr, "h", 1) == 0) {
endptr += 1;
} else if (strncmp(endptr, "d", 1) == 0) {
endptr += 1;
tmp_double_val *= H_PER_D;
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"min\", \"h\", and \"d\".\n", paraname);
return FAILURE;
}
} else if (UNIT_D == unitval) {
if (strncmp(endptr, "d", 1) == 0) {
endptr += 1;
} else {
(void)write_stderr("ERROR: Valid units for this parameter \"%s\" is \"d\".\n", paraname);
return FAILURE;
}
} else {
return FAILURE;
}
/* overflow processing */
if (FAILURE == check_double_overflow(paraname, double_val, isinf(tmp_double_val) ||
isinf((double)per_unit_transfer), tmp_double_val == 0 || (double)per_unit_transfer == 0)) {
return FAILURE;
}
}
if (NULL != result_double) {
*result_double = double_val;
}
while (isspace((unsigned char)*endptr))
endptr++;
if (*endptr != '\0')
return FAILURE;
if (isInt) {
if (tmp_double_val > LLONG_MAX || tmp_double_val < LLONG_MIN)
return FAILURE;
if (NULL != result_int)
*result_int = (int64)tmp_double_val;
} else {
if (NULL != result_double)
*result_double = (double)tmp_double_val;
}
return SUCCESS;
}
@ -4313,8 +4416,7 @@ int is_value_in_range(const char* guc_list_value, const char* value)
return FAILURE;
}
/*
************************************************************************************
/*************************************************************************************
Function: check_enum_type_value
Desc : check the parameter value of enum type.
Input : paraname parameter name
@ -4322,15 +4424,14 @@ int is_value_in_range(const char* guc_list_value, const char* value)
value parameter value
Return : SUCCESS
FAILURE
************************************************************************************
*/
*************************************************************************************/
int check_enum_type_value(const char* paraname, char* guc_list_value, const char* value)
{
char guc_val[MAX_VALUE_LEN] = {0};
int nRet = 0;
char* vptr = NULL;
const char* vptr = NULL;
char* vouter_ptr = NULL;
char* p = NULL;
const char* p = NULL;
char delims[] = ",";
char tmp_paraname[MAX_PARAM_LEN];
@ -4507,136 +4608,3 @@ static char* GetEnvStr(const char* env)
#ifdef __cplusplus
}
#endif /* __cplusplus */
/*
************************************************************************************
Function: parse_value
Desc : parese value from guc config file.
paraname parameter name
unitval the unit of parameter from guc config file
new_unitval the unit of parameter
endptr the address of parameter value
tmp_val the temporary value of parameter value
Return : SUCCESS
FAILURE
************************************************************************************
*/
template <typename T>
static int parse_value(
const char* paraname, const UnitType unitval, const UnitType new_unitval, const char* endptr, T* tmp_val)
{
switch (unitval) {
case UNIT_ERROR: {
(void)write_stderr("ERROR: Invalid units for this parameter \"%s\".\n", paraname);
return FAILURE;
}
case UNIT_KB: {
if (new_unitval == UNIT_KB || new_unitval == UNIT_MB || new_unitval == UNIT_GB) {
endptr += 2;
*tmp_val *= g_unit_transform[UNIT_KB][new_unitval];
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"kB\", \"MB\" and \"GB\".\n", paraname);
return FAILURE;
}
break;
}
case UNIT_MB: {
if (new_unitval == UNIT_MB || new_unitval == UNIT_GB) {
endptr += 2;
*tmp_val *= g_unit_transform[UNIT_MB][new_unitval];
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"MB\" and \"GB\".\n", paraname);
return FAILURE;
}
break;
}
case UNIT_GB: {
if (new_unitval == UNIT_GB) {
endptr += 2;
} else {
(void)write_stderr("ERROR: Valid units for this parameter \"%s\" is \"GB\".\n", paraname);
return FAILURE;
}
break;
}
case UNIT_MS: {
if (new_unitval == UNIT_MS) {
endptr += 2;
} else if (new_unitval == UNIT_S || new_unitval == UNIT_H || new_unitval == UNIT_D) {
endptr += 1;
*tmp_val *= g_unit_transform[UNIT_MS][new_unitval];
} else if (new_unitval == UNIT_MIN) {
endptr += 3;
*tmp_val *= g_unit_transform[UNIT_MS][new_unitval];
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"ms\", \"s\", \"min\", \"h\", and \"d\".\n",
paraname);
return FAILURE;
}
break;
}
case UNIT_S: {
if (new_unitval == UNIT_S || new_unitval == UNIT_H || new_unitval == UNIT_D) {
endptr += 1;
*tmp_val *= g_unit_transform[UNIT_S][new_unitval];
} else if (new_unitval == UNIT_MIN) {
endptr += 3;
*tmp_val *= g_unit_transform[UNIT_S][new_unitval];
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"s\", \"min\", \"h\", and \"d\".\n",
paraname);
return FAILURE;
}
break;
}
case UNIT_MIN: {
if (new_unitval == UNIT_H || new_unitval == UNIT_D) {
endptr += 1;
*tmp_val *= g_unit_transform[UNIT_MIN][new_unitval];
} else if (new_unitval == UNIT_MIN) {
endptr += 3;
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"min\", \"h\", and \"d\".\n", paraname);
return FAILURE;
}
break;
}
case UNIT_H:{
if (new_unitval == UNIT_H || new_unitval == UNIT_D) {
endptr += 1;
*tmp_val *= g_unit_transform[UNIT_H][new_unitval];
} else {
(void)write_stderr(
"ERROR: Valid units for this parameter \"%s\" are \"min\", \"h\", and \"d\".\n", paraname);
return FAILURE;
}
break;
}
case UNIT_D:{
if (new_unitval == UNIT_D) {
endptr += 1;
} else {
(void)write_stderr("ERROR: Valid units for this parameter \"%s\" is \"d\".\n", paraname);
return FAILURE;
}
break;
}
default: {
return FAILURE;
}
}
while (isspace((unsigned char)*endptr))
endptr++;
if (*endptr != '\0') {
return FAILURE;
}
return SUCCESS;
}

0
src/bin/gs_guc/crypt.cpp Executable file → Normal file
View File

0
src/bin/gs_guc/crypt.h Executable file → Normal file
View File

0
src/bin/gs_guc/encrypt.cpp Executable file → Normal file
View File

View File

@ -443,7 +443,19 @@ char* xstrdup(const char* s)
}
return result;
}
/*
* @@GaussDB@@
* Brief : char* skipspace(char *p)
* Description : Skip all the blanks at the begin of p
* Notes :
*/
static char* skipspace(char *p)
{
while (isspace((unsigned char)*p)) {
p++;
}
return p;
}
/*
* @@GaussDB@@
* Brief : static pgpid_t get_pgpid(void)
@ -630,7 +642,7 @@ static void to_generatenewline(char* oldline, char* newline, const char* param,
poldline++;
pnewline++;
offsetlen++;
while (isspace((unsigned char)*poldline)) {
while (isspace((unsigned char)*poldline) && (unsigned char)*poldline != '\n') {
rc = strncpy_s(pnewline, MAX_VALUE_LEN * 2 - offsetlen, poldline, 1);
securec_check_c(rc, "\0", "\0");
poldline++;
@ -1023,6 +1035,7 @@ append_string_info(char **optLines, const char *newContext)
return optLinesResult;
}
#ifndef ENABLE_MULTIPLE_NODES
/*******************************************************************************
Function : IsLastNotNullReplconninfo
Description : determine if replconninfoX which is being set is the last one valid replconninfo
@ -1091,6 +1104,19 @@ static bool IsLastNotNullReplconninfo(char** optLines, char* replconninfoX)
return false;
}
static void CheckLastValidReplconninfo(char** opt_lines, int idx)
{
/* Give a warning if the last valid replconninfo is set to a invalid value currently */
if (strncmp(config_param[idx], "replconninfo", strlen("replconninfo")) == 0 &&
config_value[idx] != NULL && (strlen(config_value[idx]) == 0 ||
strncmp(config_value[idx], "''", strlen("''")) == 0) &&
IsLastNotNullReplconninfo(opt_lines, config_param[idx])) {
write_stderr("\nWARNING: This is the last valid replConnInfo, once set to null, "
"the host role will be changed to Normal if the local_role is primary now.\n");
}
}
#endif
/*
* @@GaussDB@@
* Brief :
@ -1152,6 +1178,7 @@ do_gucset(const char *action_type, const char *data_dir)
if (NULL == config_param[i]) {
release_file_lock(&filelock);
freefile(opt_lines);
GS_FREE(tmpAZStr);
write_stderr( _("%s: invalid input parameters\n"), progname);
return FAILURE;
}
@ -1163,6 +1190,7 @@ do_gucset(const char *action_type, const char *data_dir)
if (FAILURE == get_global_local_node_name()) {
release_file_lock(&filelock);
freefile(opt_lines);
GS_FREE(tmpAZStr);
return FAILURE;
}
@ -1181,13 +1209,10 @@ do_gucset(const char *action_type, const char *data_dir)
GS_FREE(azString);
}
}
/* Give a warning if the last valid replconninfo is set to a invalid value currently */
if (strncmp(config_param[i], "replconninfo", strlen("replconninfo")) == 0 &&
config_value[i] != NULL && (strlen(config_value[i]) == 0 || strncmp(config_value[i], "''", strlen("''")) == 0) &&
IsLastNotNullReplconninfo(opt_lines, config_param[i])) {
write_stderr("\nWARNING: This is the last valid replConnInfo, once set to null, "
"the host role will be changed to Normal if the local_role is primary now.\n");
}
#ifndef ENABLE_MULTIPLE_NODES
CheckLastValidReplconninfo(opt_lines, i);
#endif
/* find the line where guc parameter in */
lines_index = find_gucoption(opt_lines, config_param[i], NULL, NULL, &optvalue_off, &optvalue_len);
@ -1204,17 +1229,16 @@ do_gucset(const char *action_type, const char *data_dir)
to_generatenewline(optconf_line, newconf_line, config_param[i], config_value[i], optvalue_len);
} else {
/*
* if parameter value is NULL, not consider it as UNSET,
* which means maintain the configuration parameter, and
* there will be prompts telling the user to assign a value.
* if parameter as value is NULL; consider it as UNSET (i.e to default value)
* which means comment the configuration parameter
*/
//line is commented
if (isOptLineCommented(optconf_line)) {
rc = strncpy_s(newconf_line, MAX_PARAM_LEN*2, optconf_line, (size_t)Min(line_len, MAX_PARAM_LEN*2 - 1));
securec_check_c(rc, "\0", "\0");
} else {
write_stderr(_("ERROR: %s parameters value is expected\n"), config_param[i]);
return FAILURE;
nRet = snprintf_s(newconf_line, MAX_PARAM_LEN*2, MAX_PARAM_LEN*2 - 1, "#%s", optconf_line);
securec_check_ss_c(nRet, "\0", "\0");
}
}
updateoradd = UPDATE_PARAMETER;
@ -1433,10 +1457,10 @@ static void do_help_check_guc(void)
#else
(void)printf(_("\nChecking GUC parameters:\n"));
(void)printf(_(" %s check [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c \"parameter\", -c "
(void)printf(_(" %s check [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c \"parameter\", -c "
"\"parameter\", ...}\n"),
progname);
(void)printf(_(" %s check [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c parameter, -c "
(void)printf(_(" %s check [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} {-c parameter, -c "
"parameter, ...}\n"),
progname);
@ -1493,20 +1517,20 @@ static void do_help_config_guc(void)
_(" e.g. %s set -Z cmagent -N all -I all -c \"program = \'\\\"Hello\\\", World\\!\'\".\n"), progname);
(void)printf(_(" e.g. %s set -Z cmagent -c \"program = \'\\\"Hello\\\", World\\!\'\".\n"), progname);
#else
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
"[--lcname=LCNAME] {-c \"parameter = value\" -c \"parameter = value\" ...}\n"), progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
"[--lcname=LCNAME] {-c \" parameter = value \" -c \" parameter = value \" ...}\n"), progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
"[--lcname=LCNAME] {-c \"parameter = \'value\'\" -c \"parameter = \'value\'\" ...}\n"), progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
"[--lcname=LCNAME] {-c \" parameter = \'value\' \" -c \" parameter = \'value\' \" ...}\n"), progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} "
"[--lcname=LCNAME] {-c \"parameter\" -c \"parameter\" ...}\n"), progname);
(void)printf(
_(" e.g. %s set -N all -I all -c \"program = \'\\\"Hello\\\", World\\!\'\".\n"), progname);
_(" e.g. %s set -Z datanode -N all -I all -c \"program = \'\\\"Hello\\\", World\\!\'\".\n"), progname);
(void)printf(
_(" e.g. %s reload -N all -I all -c \"program = \'\\\"Hello\\\", World\\!\'\".\n"), progname);
_(" e.g. %s reload -Z datanode -N all -I all -c \"program = \'\\\"Hello\\\", World\\!\'\".\n"), progname);
#endif
@ -1548,25 +1572,25 @@ static void do_help_config_hba(void)
"DATABASE USERNAME HOSTNAME\" \n"),
progname);
#else
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
"DATABASE USERNAME IPADDR IPMASK AUTHMEHOD authentication-options\" \n"),
progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
"DATABASE USERNAME IPADDR-WITH-IPMASK AUTHMEHOD authentication-options\" \n"),
progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
"DATABASE USERNAME HOSTNAME AUTHMEHOD authentication-options\" \n"),
progname);
(void)printf(_(" If authentication policy need to set/reload DEFAULT OR COMMENT then provide without "
"authentication menthod, use the form: \n"));
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
"DATABASE USERNAME IPADDR IPMASK\" \n"),
progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
"DATABASE USERNAME IPADDR-WITH-IPMASK \" \n"),
progname);
(void)printf(_(" %s {set | reload} [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
(void)printf(_(" %s {set | reload} [-Z NODE-TYPE] [-N NODE-NAME] {-I INSTANCE-NAME | -D DATADIR} -h \"HOSTTYPE "
"DATABASE USERNAME HOSTNAME\" \n"),
progname);
#endif
@ -1611,11 +1635,9 @@ static void do_help_set_reset_options(void)
#ifdef ENABLE_MULTIPLE_NODES
(void)printf(_("\nOptions for set with -c parameter: \n"));
(void)printf(_(" -Z NODE-TYPE can be \"coordinator\", \"datanode\", \"cmserver\", \"cmagent\", or \"gtm\""));
(void)printf(_(" -Z NODE-TYPE can be \"coordinator\", \"datanode\", \"cmserver\", \"cmagent\", or \"gtm\". "));
(void)printf(_("NODE-TYPE is used to identify configuration file (with -c parameter) in data directory\n"));
(void)printf(_(" \"coordinator\" or \"datanode\" -- postgresql.conf\n"));
(void)printf(_(" \"coordinator\" and \"datanode\" -- postgresql.conf\n"));
(void)printf(_(" \"cmserver\" -- cm_server.conf\n"));
@ -1624,6 +1646,16 @@ static void do_help_set_reset_options(void)
(void)printf(_("\nOptions for set and reload with -h host-auth-policy: \n"));
(void)printf(_(" -Z NODE-TYPE can be \"coordinator\", or \"datanode\"\n"));
#else
(void)printf(_("\nOptions for set with -c parameter: \n"));
(void)printf(_(" -Z NODE-TYPE can only be \"datanode\", default is \"datanode\". "));
(void)printf(_("NODE-TYPE is used to identify configuration file (with -c parameter) in data directory\n"));
(void)printf(_(" \"datanode\" -- postgresql.conf\n"));
(void)printf(_("\nOptions for set and reload with -h host-auth-policy: \n"));
(void)printf(_(" -Z NODE-TYPE can only be \"datanode\", default is \"datanode\"\n"));
#endif
}
@ -3043,18 +3075,14 @@ static bool isMatchOptionName(
p = optLine;
/* Skip all the blanks at the begin of the optLine */
while (isspace((unsigned char)*p)) {
p++;
}
p = skipspace(p);
if ('#' == *p) {
p++;
}
/* Skip all the blanks after '#' and before the paraName */
while (isspace((unsigned char)*p)) {
p++;
}
p = skipspace(p);
if (find_param_in_string(p, paraName, paraLength) != 0) {
return false;
@ -3065,9 +3093,7 @@ static bool isMatchOptionName(
}
p += paraLength;
while (isspace((unsigned char)*p)) {
p++;
}
p = skipspace(p);
/* If not '=', this optLine's format is wrong in configure file */
if (*p != '=') {
@ -3077,27 +3103,27 @@ static bool isMatchOptionName(
p++;
/* Skip all the blanks after '=' and before the value */
while (isspace((unsigned char)*p)) {
p++;
}
q = p + 1;
tmp = q;
p = skipspace(p);
while (*q && !('\n' == *q || '#' == *q)) {
if (!isspace((unsigned char)*q)) {
/* End of string */
if ('\'' == *q) {
tmp = ++q;
break;
if (strlen(p) != 0) {
q = p + 1;
tmp = q;
while (*q && !('\n' == *q || '#' == *q)) {
if (!isspace((unsigned char)*q)) {
/* End of string */
if ('\'' == *q) {
tmp = ++q;
break;
} else {
tmp = ++q;
}
} else {
tmp = ++q;
/*
* If paraName is a string, the ' ' is considered to
* be part of the string.
*/
('\'' == *p) ? tmp = ++q : q++;
}
} else {
/*
* If paraName is a string, the ' ' is considered to
* be part of the string.
*/
('\'' == *p) ? tmp = ++q : q++;
}
}

0
src/bin/gs_guc/pg_hba.cpp Executable file → Normal file
View File

Some files were not shown because too many files have changed in this diff Show More