mirror of https://github.com/citusdata/citus.git
Allow providing "host" parameter via citus.node_conninfo
And when that is the case, directly use it as "host" parameter for the connections between nodes and use the "hostname" provided in pg_dist_node as "hostaddr" to avoid host name lookup. In that case, the value for "host" becomes useful only if the authentication method requires it. Note to self: This change requires updating https://docs.citusdata.com/en/latest/develop/api_guc.html#citus-node-conninfo-text.pull/7541/head
parent
f4242685e3
commit
1eb4f1277f
|
@ -271,9 +271,24 @@ GetConnParams(ConnectionHashKey *key, char ***keywords, char ***values,
|
|||
* We allocate everything in the provided context so as to facilitate using
|
||||
* pfree on all runtime parameters when connections using these entries are
|
||||
* invalidated during config reloads.
|
||||
*
|
||||
* Also, when "host" is already provided in global parameters, we use hostname
|
||||
* from the key as "hostaddr" instead of "host" to avoid host name lookup. In
|
||||
* that case, the value for "host" becomes useful only if the authentication
|
||||
* method requires it.
|
||||
*/
|
||||
bool gotHostParamFromGlobalParams = false;
|
||||
for (Size paramIndex = 0; paramIndex < ConnParams.size; paramIndex++)
|
||||
{
|
||||
if (strcmp(ConnParams.keywords[paramIndex], "host") == 0)
|
||||
{
|
||||
gotHostParamFromGlobalParams = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const char *runtimeKeywords[] = {
|
||||
"host",
|
||||
gotHostParamFromGlobalParams ? "hostaddr" : "host",
|
||||
"port",
|
||||
"dbname",
|
||||
"user",
|
||||
|
|
|
@ -2929,6 +2929,7 @@ NodeConninfoGucCheckHook(char **newval, void **extra, GucSource source)
|
|||
#if defined(ENABLE_GSS) && defined(ENABLE_SSPI)
|
||||
"gsslib",
|
||||
#endif
|
||||
"host",
|
||||
"keepalives",
|
||||
"keepalives_count",
|
||||
"keepalives_idle",
|
||||
|
|
Loading…
Reference in New Issue