bugfix 修复无法使用域名搭建主从bug,如果replconninfo中配置域名,则无法与 pg_getnameinfo_all获取的IP比较 ,只能和port->remote_host中的域名比较。

This commit is contained in:
jiang wei 2022-03-03 10:32:19 +08:00
parent d26ec83e7b
commit cede8802dc
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;
}