From b8f3b8a7a2688a73c34f797151248c0c3659a3c9 Mon Sep 17 00:00:00 2001 From: chendong76 <1209756284@qq.com> Date: Tue, 23 May 2023 11:38:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=88=A0=E9=99=A4postgresql=5Fsingle.conf.?= =?UTF-8?q?sample=E5=86=85=E7=9A=84ss=5Fenable=5Freform=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/misc/postgresql_single.conf.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common/backend/utils/misc/postgresql_single.conf.sample b/src/common/backend/utils/misc/postgresql_single.conf.sample index ffe049cce4..278ae73e27 100644 --- a/src/common/backend/utils/misc/postgresql_single.conf.sample +++ b/src/common/backend/utils/misc/postgresql_single.conf.sample @@ -822,7 +822,6 @@ job_queue_processes = 10 # Number of concurrent jobs, optional: [0..1000] #------------------------------------------------------------------------------ #ss_enable_dms = off #ss_enable_dss = off -#ss_enable_reform = on #ss_enable_ssl = on #ss_enable_aio = on #ss_enable_catalog_centralized = on -- Gitee From 8fce2a0363bb258810de45bdef6d414795e1cae8 Mon Sep 17 00:00:00 2001 From: chendong76 <1209756284@qq.com> Date: Tue, 23 May 2023 14:12:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=A7=A3=E5=86=B3gs=5Fprobackup=E6=9C=AA?= =?UTF-8?q?=E8=BE=93=E5=85=A5vgname=E5=BC=95=E5=8F=91=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E6=8C=87=E9=92=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/pg_probackup/pg_probackup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/pg_probackup/pg_probackup.cpp b/src/bin/pg_probackup/pg_probackup.cpp index 85045453a9..f0275344cf 100644 --- a/src/bin/pg_probackup/pg_probackup.cpp +++ b/src/bin/pg_probackup/pg_probackup.cpp @@ -949,6 +949,10 @@ static void dss_init(void) elog(ERROR, "Remote operations on dss mode are not supported"); } + if (instance_config.dss.vgname == NULL) { + elog(ERROR, "Vgname must be specified in dss mode."); + } + parse_vgname_args(instance_config.dss.vgname); /* Check dss connect */ -- Gitee From a6e8f45825459011a91c05fa5c31a66a5b3d88d1 Mon Sep 17 00:00:00 2001 From: chendong76 <1209756284@qq.com> Date: Tue, 23 May 2023 14:31:47 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E4=B8=8Bmax=5Fconnections=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=B6=85=E8=BF=87=E6=9C=80=E5=A4=A7=E5=80=BC=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/backend/utils/misc/guc/guc_network.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/backend/utils/misc/guc/guc_network.cpp b/src/common/backend/utils/misc/guc/guc_network.cpp index a0dced21dc..2d3475e89c 100755 --- a/src/common/backend/utils/misc/guc/guc_network.cpp +++ b/src/common/backend/utils/misc/guc/guc_network.cpp @@ -1100,7 +1100,7 @@ static bool check_maxconnections(int* newval, void** extra, GucSource source) #ifdef PGXC if (IS_PGXC_COORDINATOR && *newval > MAX_BACKENDS) { - ereport(LOG, (errmsg("PGXC can't support max_connections more than %d.", MAX_BACKENDS))); + GUC_check_errmsg("PGXC can't support max_connections more than %d.", MAX_BACKENDS); return false; } #endif @@ -1111,7 +1111,7 @@ static bool check_maxconnections(int* newval, void** extra, GucSource source) } if (g_instance.attr.attr_storage.dms_attr.enable_dms && *newval > DMS_MAX_CONNECTIONS) { - ereport(LOG, (errmsg("Shared Storage can't support max_connections more than %d.", DMS_MAX_CONNECTIONS))); + GUC_check_errmsg("Shared Storage can't support max_connections more than %d.", DMS_MAX_CONNECTIONS); return false; } return true; -- Gitee From 0155d94731191a281ef7f79827ff5ad37c798080 Mon Sep 17 00:00:00 2001 From: chendong76 <1209756284@qq.com> Date: Tue, 23 May 2023 14:46:23 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=B1=A0=E5=8C=96=E5=B7=A5=E5=85=B7pagehack,pg=5Fxlogdump,pg?= =?UTF-8?q?=5Fcontroldata,pg=5Fresetxlog=E9=92=88=E5=AF=B9socketpath?= =?UTF-8?q?=E5=90=88=E6=B3=95=E5=80=BC=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contrib/pagehack/pagehack.cpp | 5 +++-- contrib/pg_xlogdump/pg_xlogdump.cpp | 6 ++++-- src/bin/pg_controldata/pg_controldata.cpp | 5 +++-- src/bin/pg_resetxlog/pg_resetxlog.cpp | 5 +++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/contrib/pagehack/pagehack.cpp b/contrib/pagehack/pagehack.cpp index 0ffc38ac82..d9058366e2 100644 --- a/contrib/pagehack/pagehack.cpp +++ b/contrib/pagehack/pagehack.cpp @@ -5750,8 +5750,9 @@ int main(int argc, char** argv) exit(1); } - if (enable_dss && socketpath == NULL) { - fprintf(stderr, "Socketpath cannot be NULL when enable dss.\n"); + if (enable_dss && (socketpath == NULL || strlen(socketpath) == 0 || strncmp("UDS:", socketpath, 4) != 0)) { + fprintf(stderr, "Socketpath must be specific correctly when enable dss, " + "format is: '-c UDS:xxx'.\n"); exit(1); } diff --git a/contrib/pg_xlogdump/pg_xlogdump.cpp b/contrib/pg_xlogdump/pg_xlogdump.cpp index 4885fff5c2..723db46a10 100644 --- a/contrib/pg_xlogdump/pg_xlogdump.cpp +++ b/contrib/pg_xlogdump/pg_xlogdump.cpp @@ -1012,8 +1012,10 @@ int main(int argc, char** argv) } if (dumpprivate.enable_dss) { - if (dumpprivate.socketpath == NULL) { - fprintf(stderr, "%s: socketpath cannot be NULL when enable dss\n", progname); + if (dumpprivate.socketpath == NULL || strlen(dumpprivate.socketpath) == 0 || + strncmp("UDS:", dumpprivate.socketpath, 4) != 0) { + fprintf(stderr, "%s: socketpath must be specific correctly when enable dss, " + "format is: '--socketpath=\"UDS:xxx\"'.\n", progname); goto bad_argument; } diff --git a/src/bin/pg_controldata/pg_controldata.cpp b/src/bin/pg_controldata/pg_controldata.cpp index 328d76f7ca..845d552c7e 100644 --- a/src/bin/pg_controldata/pg_controldata.cpp +++ b/src/bin/pg_controldata/pg_controldata.cpp @@ -327,8 +327,9 @@ int main(int argc, char* argv[]) check_env_value_c(DataDir); if (enable_dss) { - if (socketpath == NULL) { - fprintf(stderr, _("%s: socketpath cannot be NULL when enable dss\n"), progname); + if (socketpath == NULL || strlen(socketpath) == 0 || strncmp("UDS:", socketpath, 4) != 0) { + fprintf(stderr, _("%s: socketpath must be specific correctly when enable dss, " + "format is: '--socketpath=\"UDS:xxx\"'.\n"), progname); exit_safely(1); } diff --git a/src/bin/pg_resetxlog/pg_resetxlog.cpp b/src/bin/pg_resetxlog/pg_resetxlog.cpp index b13c62ed82..9b7d27fa2b 100644 --- a/src/bin/pg_resetxlog/pg_resetxlog.cpp +++ b/src/bin/pg_resetxlog/pg_resetxlog.cpp @@ -276,8 +276,9 @@ int main(int argc, char* argv[]) } if (dss.enable_dss) { - if (dss.socketpath == NULL) { - fprintf(stderr, _("%s: socketpath cannot be NULL when enable dss\n"), progname); + if (dss.socketpath == NULL || strlen(dss.socketpath) == 0 || strncmp("UDS:", dss.socketpath, 4) != 0) { + fprintf(stderr, _("%s: socketpath must be specific correctly when enable dss, " + "format is: '--socketpath=\"UDS:xxx\"'.\n"), progname); exit(1); } if (dss.vgname == NULL) { -- Gitee