!1558 修复无法使用域名搭建主从bug

Merge pull request !1558 from sharpwei/master
This commit is contained in:
opengauss-bot 2022-03-18 03:01:39 +00:00 committed by Gitee
commit c1399b1719
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 2 additions and 1 deletions

View File

@ -2197,7 +2197,8 @@ bool is_node_internal_connection(hbaPort* port)
} else {
replconninfo = u_sess->attr.attr_storage.ReplConnInfoArr[i];
}
if (replconninfo && *replconninfo != '\0' && strcasestr(replconninfo, remote_host) != NULL) {
if (replconninfo && *replconninfo != '\0' && (strcasestr(replconninfo, remote_host) != NULL ||
strcasestr(replconninfo, port->remote_host) != NULL)) {
ereport(DEBUG2, (errmsg("remote host is:%s in replconninfo %s", remote_host, replconninfo)));
return true;
}