!1555 订阅端应该连接到发布端的HA端口

Merge pull request !1555 from pengjiong/sub_auth
This commit is contained in:
opengauss-bot 2022-03-16 02:00:04 +00:00 committed by Gitee
commit cba028b3c2
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 7 additions and 0 deletions

View File

@ -3886,6 +3886,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 ||