diff --git a/src/common/backend/libpq/be-secure.cpp b/src/common/backend/libpq/be-secure.cpp index 058d96a37..cab37b5d5 100644 --- a/src/common/backend/libpq/be-secure.cpp +++ b/src/common/backend/libpq/be-secure.cpp @@ -448,7 +448,7 @@ readloop: ssize_t secure_read(Port *port, void *ptr, size_t len) { ssize_t n = 0; - if (u_sess->attr.attr_common.light_comm == TRUE) { + if (g_instance.attr.attr_common.light_comm == TRUE) { n = light_secure_read(port, ptr, len); } else { n = old_secure_read(port, ptr, len); @@ -696,7 +696,7 @@ retry: ssize_t secure_write(Port *port, void *ptr, size_t len) { ssize_t n = 0; - if (u_sess->attr.attr_common.light_comm == TRUE) { + if (g_instance.attr.attr_common.light_comm == TRUE) { n = light_secure_write(port, ptr, len); } else { n = old_secure_write(port, ptr, len); diff --git a/src/common/backend/libpq/pqcomm.cpp b/src/common/backend/libpq/pqcomm.cpp index 757486aea..dff215a44 100644 --- a/src/common/backend/libpq/pqcomm.cpp +++ b/src/common/backend/libpq/pqcomm.cpp @@ -464,7 +464,7 @@ void pq_init(void) * should always use COMMERROR on failure during communication */ #ifndef WIN32 - if (u_sess->attr.attr_common.light_comm == TRUE && + if (g_instance.attr.attr_common.light_comm == TRUE && u_sess->proc_cxt.MyProcPort->sock != PGINVALID_SOCKET && !pg_set_noblock(u_sess->proc_cxt.MyProcPort->sock)){ ereport(COMMERROR, (errmsg("could not set socket to nonblocking mode: %m"))); } @@ -1172,7 +1172,7 @@ void TouchSocketFile(void) */ void pq_set_nonblocking(bool nonblocking) { - if (u_sess->attr.attr_common.light_comm == FALSE) { + if (g_instance.attr.attr_common.light_comm == FALSE) { if (u_sess->proc_cxt.MyProcPort->noblock == nonblocking) { return; } diff --git a/src/common/backend/utils/misc/guc.cpp b/src/common/backend/utils/misc/guc.cpp index c3c376e70..21554bd15 100755 --- a/src/common/backend/utils/misc/guc.cpp +++ b/src/common/backend/utils/misc/guc.cpp @@ -1979,13 +1979,13 @@ static void InitConfigureNamesBool() NULL }, {{"light_comm", - PGC_BACKEND, + PGC_POSTMASTER, NODE_ALL, CLIENT_CONN, gettext_noop("Enable to use light connection"), NULL, }, - &u_sess->attr.attr_common.light_comm, + &g_instance.attr.attr_common.light_comm, false, NULL, NULL, diff --git a/src/gausskernel/optimizer/commands/async.cpp b/src/gausskernel/optimizer/commands/async.cpp index b34fb057f..28c631c31 100644 --- a/src/gausskernel/optimizer/commands/async.cpp +++ b/src/gausskernel/optimizer/commands/async.cpp @@ -1498,7 +1498,7 @@ void HandleNotifyInterrupt(void) notifyInterruptPending = true; /* make sure the event is processed in due course */ - if (u_sess->attr.attr_common.light_comm== TRUE && t_thrd.proc) { + if (g_instance.attr.attr_common.light_comm== TRUE && t_thrd.proc) { SetLatch(&t_thrd.proc->procLatch); } } diff --git a/src/gausskernel/process/tcop/postgres.cpp b/src/gausskernel/process/tcop/postgres.cpp index 8ce3c992c..e15ef8997 100755 --- a/src/gausskernel/process/tcop/postgres.cpp +++ b/src/gausskernel/process/tcop/postgres.cpp @@ -486,7 +486,7 @@ static int InteractiveBackend(StringInfo inBuf) static int interactive_getc(void) { int c; - if (u_sess->attr.attr_common.light_comm == FALSE) { + if (g_instance.attr.attr_common.light_comm == FALSE) { prepare_for_client_read(); c = getc(stdin); client_read_ended(); @@ -6064,7 +6064,7 @@ void die(SIGNAL_ARGS) if (t_thrd.proc) SetLatch(&t_thrd.proc->procLatch); - if (u_sess->attr.attr_common.light_comm == TRUE && + if (g_instance.attr.attr_common.light_comm == TRUE && t_thrd.postgres_cxt.DoingCommandRead && t_thrd.postgres_cxt.whereToSendOutput != DestRemote) { ProcessInterrupts(); diff --git a/src/gausskernel/storage/ipc/sinval.cpp b/src/gausskernel/storage/ipc/sinval.cpp index b501e7b53..5954ffc5e 100644 --- a/src/gausskernel/storage/ipc/sinval.cpp +++ b/src/gausskernel/storage/ipc/sinval.cpp @@ -225,7 +225,7 @@ void HandleCatchupInterrupt(void) * you do here. */ catchupInterruptPending = true; - if (u_sess->attr.attr_common.light_comm == TRUE && t_thrd.proc) { + if (g_instance.attr.attr_common.light_comm == TRUE && t_thrd.proc) { SetLatch(&t_thrd.proc->procLatch); } } diff --git a/src/include/knl/knl_guc/knl_session_attr_common.h b/src/include/knl/knl_guc/knl_session_attr_common.h index 5902798a3..47da2d5ab 100644 --- a/src/include/knl/knl_guc/knl_session_attr_common.h +++ b/src/include/knl/knl_guc/knl_session_attr_common.h @@ -240,7 +240,6 @@ typedef struct knl_session_attr_common { int threadpool_reset_percent_list[2]; bool enable_indexscan_optimization; char* delimiter_name; - bool light_comm; bool test_user_host; } knl_session_attr_common;