Skip to content

Commit

Permalink
[PLAT-15962]: Add support for pg-upgrade on auth enabled non-dedicate…
Browse files Browse the repository at this point in the history
…d node based universes.

Summary: Added support for pg-upgrade on auth enabled universes.

Test Plan: tested manually

Reviewers: sanketh, hsunder

Reviewed By: sanketh, hsunder

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D39728
  • Loading branch information
vipul-yb committed Nov 6, 2024
1 parent 4cbf9c1 commit 5ffca27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import com.yugabyte.yw.common.ShellProcessContext;
import com.yugabyte.yw.common.ShellResponse;
import com.yugabyte.yw.common.Util;
import com.yugabyte.yw.common.gflags.GFlagsUtil;
import com.yugabyte.yw.forms.UniverseDefinitionTaskParams;
import com.yugabyte.yw.models.Universe;
import com.yugabyte.yw.models.helpers.NodeDetails;
import java.util.ArrayList;
Expand Down Expand Up @@ -69,6 +71,8 @@ private void runCheckOnNode(Universe universe, NodeDetails node) {
Architecture arch = universe.getUniverseDetails().arch;
ReleaseContainer release = releaseManager.getReleaseByVersion(taskParams().ybSoftwareVersion);
String ybServerPackage = release.getFilePath(arch);
UniverseDefinitionTaskParams.Cluster primaryCluster =
universe.getUniverseDetails().getPrimaryCluster();
String pgUpgradeBinaryLocation =
nodeUniverseManager.getYbHomeDir(node, universe)
+ "/yb-software/"
Expand All @@ -79,7 +83,18 @@ private void runCheckOnNode(Universe universe, NodeDetails node) {
String pgDataDir = Util.getDataDirectoryPath(universe, node, config) + "/pg_data";
command.add(pgDataDir);
command.add("--old-host");
command.add(node.cloudInfo.private_ip);
if (primaryCluster.userIntent.enableYSQLAuth) {
String customTmpDirectory = GFlagsUtil.getCustomTmpDirectory(node, universe);
command.add(String.format("'$(ls -d -t %s/.yb.* | head -1)'", customTmpDirectory));
} else {
command.add(node.cloudInfo.private_ip);
}
command.add("--old-port");
if (primaryCluster.userIntent.enableConnectionPooling) {
command.add(String.valueOf(node.internalYsqlServerRpcPort));
} else {
command.add(String.valueOf(node.ysqlServerRpcPort));
}
command.add("--username");
command.add("\"yugabyte\"");
command.add("--check");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,6 @@ protected void createPrecheckTasks(Universe universe, String newVersion) {
&& universe.getUniverseDetails().getPrimaryCluster().userIntent.enableYSQL;

if (ysqlMajorVersionUpgrade) {
// This is a temp check and it will be removed once we have solution from DB team.
if (universe.getUniverseDetails().getPrimaryCluster().userIntent.enableYSQLAuth) {
throw new PlatformServiceException(
Status.INTERNAL_SERVER_ERROR, "YSQL Auth is not supported with PG15 upgrade");
}

// This is a temp check and it will be removed once we have solution from DB team.
if (universe.getUniverseDetails().getPrimaryCluster().userIntent.dedicatedNodes) {
Expand Down

0 comments on commit 5ffca27

Please sign in to comment.