Skip to content

Commit 9b52757

Browse files
committed
[PLAT-18434] Override 'pgsql_proxy_bind_address' to 'internalYsqlServerRpcPort' when CP is enabled in non-restart Gflags flow
Summary: Override 'pgsql_proxy_bind_address' to 'internalYsqlServerRpcPort' when CP is enabled in non-restart Gflags flow. Test Plan: Manually tested the non restart gflag upgrade flow and ensured the correct port is used after the upgrade now. Reviewers: sneelakantan Reviewed By: sneelakantan Differential Revision: https://phorge.dev.yugabyte.com/D46579
1 parent 99e3ad3 commit 9b52757

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

managed/src/main/java/com/yugabyte/yw/commissioner/tasks/subtasks/SetFlagInMemory.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,20 @@ public void run() {
114114
gflags.put(GFlagsUtil.YSQL_PG_CONF_CSV, finalYsqlPgConfCsv);
115115
}
116116
}
117+
if (universe.getUniverseDetails().getPrimaryCluster().userIntent.enableConnectionPooling
118+
&& gflags.containsKey(GFlagsUtil.PSQL_PROXY_BIND_ADDRESS)) {
119+
String psqlProxyBindAddress = gflags.get(GFlagsUtil.PSQL_PROXY_BIND_ADDRESS);
120+
// Remove the port from the psql proxy bind address after the colon and add the internal PG
121+
// process port.
122+
String psqlProxyBindAddressWithoutPort =
123+
psqlProxyBindAddress.substring(0, psqlProxyBindAddress.lastIndexOf(":"));
124+
String ysqlConnMgrPort =
125+
String.valueOf(
126+
universe.getUniverseDetails().communicationPorts.internalYsqlServerRpcPort);
127+
gflags.put(
128+
GFlagsUtil.PSQL_PROXY_BIND_ADDRESS,
129+
psqlProxyBindAddressWithoutPort + ":" + ysqlConnMgrPort);
130+
}
117131
// allowed_preview_flags_csv should be set first in order to set the preview flags.
118132
if (gflags.containsKey(GFlagsUtil.ALLOWED_PREVIEW_FLAGS_CSV)) {
119133
log.info(

0 commit comments

Comments
 (0)