备机连接可以走非HA端口,根据配置中的连接信息决定

This commit is contained in:
Hemny
2021-06-18 15:26:39 +08:00
committed by Gitee
parent 29c5bb6f7c
commit 4982d08338

View File

@ -3238,7 +3238,7 @@ int ProcessStartupPacket(Port* port, bool SSLdone)
#endif
}
} else if (strcmp(nameptr, "replication") == 0) {
if (!IsHAPort(u_sess->proc_cxt.MyProcPort) && g_instance.attr.attr_common.enable_thread_pool) {
if (IsLocalPort(u_sess->proc_cxt.MyProcPort) && g_instance.attr.attr_common.enable_thread_pool) {
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("replication should connect HA port in thread_pool")));
@ -3259,6 +3259,11 @@ int ProcessStartupPacket(Port* port, bool SSLdone)
if (!g_instance.attr.attr_storage.enable_mix_replication)
t_thrd.datasender_cxt.am_datasender = true;
} else if (strcmp(valptr, "database") == 0) {
if (!IsHAPort(u_sess->proc_cxt.MyProcPort) && g_instance.attr.attr_common.enable_thread_pool) {
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("logical replication should connect HA port in thread_pool")));
}
t_thrd.role = WAL_DB_SENDER;
} else {
bool _am_normal_walsender = false;