Force subscription use HA port.

This commit is contained in:
TotaJ
2022-03-02 16:54:40 +08:00
parent d26ec83e7b
commit c7d12e661d

View File

@ -3805,6 +3805,13 @@ int ProcessStartupPacket(Port* port, bool SSLdone)
port->guc_options = NIL;
}
/* subscription is allowed to use HA port only, the auth check also done in HA port */
if (u_sess->proc_cxt.clientIsSubscription && !IsHAPort(u_sess->proc_cxt.MyProcPort)) {
ereport(elevel,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("subcription should connect HA port")));
}
/* Inner tool with local sha256 will not be authenicated. */
if (clientIsCmAgent || clientIsGsClean || clientIsOM || u_sess->proc_cxt.clientIsGsroach || clientIsWDRXdb ||
clientIsRemoteRead || u_sess->proc_cxt.clientIsGsCtl || u_sess->proc_cxt.clientIsGsrewind ||