Summary:
This diff handles a couple of issues recently seen with rollback, primarily related to filesystem loops and restore failing because postgres is not up. Removes the old CreateSymlink function and replaced with Symlink which properly handles duplicate symlinks. Also reordered the rollback steps to reconfigure first so that the new services are stopped and old services are started before we attempt a restore. We also save off the yba-ctl.yml and yba_installer.state in case any migrations may have changed them, we can restore them and the reconfigure runs properly with an old yba-ctl.
There is still a difficulty with yb_platform_backup.sh as we have to use the old script since we don't know when in the rollback process the new script is available to us. Also, we don't want to rely on the backup script being backwards compatible so it is safer to backup/restore the old YBA with the old script. We may want to add a test that will catch any backup script arguments that are added but not handled in the rollback feature, or change the backup script to ignore any extraneous arguments so we don't have to have version checks in code that pass certain arguments.
Test Plan:
test upgrade
have failures in upgrade at specific times (after new postgres and prometheus fail to come up) and ensure rollback still works
Reviewers: dshubin
Reviewed By: dshubin
Subscribers: yugaware
Differential Revision: https://phorge.dev.yugabyte.com/D44557