Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Address YB_TODO in pg_upgrade.c's check_pghost_envvar #25477

Closed
1 task done
timothy-e opened this issue Jan 2, 2025 · 0 comments
Closed
1 task done

[YSQL] Address YB_TODO in pg_upgrade.c's check_pghost_envvar #25477

timothy-e opened this issue Jan 2, 2025 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@timothy-e
Copy link
Contributor

timothy-e commented Jan 2, 2025

Jira Link: DB-14727

Description

title

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@timothy-e timothy-e added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Jan 2, 2025
@timothy-e timothy-e self-assigned this Jan 2, 2025
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue and removed status/awaiting-triage Issue awaiting triage labels Jan 2, 2025
timothy-e added a commit that referenced this issue Jan 14, 2025
Summary:
`check_pghost_envvar` is used by Postgres to validate that the pg server we are connecting to for upgrade to is a local server. It checks for conditions:
```
(strcmp(value, "localhost") != 0 && strcmp(value, "127.0.0.1") != 0 && strcmp(value, "::1") != 0 && !is_unixsock_path(value)))
```

However, in Yugabyte, the servers don't necessarily match this layout. `test_upgrade.sh` creates a server with IP 127.0.0.200, which causes `check_pghost_envvar` to fail with
```
+ build/latest/postgres/bin/pg_upgrade --old-datadir /tmp/pg15_cluster_data/node-1/disk-1/pg_data --old-host 127.0.0.200 --old-port 5433 --username yugabyte --check

libpq environment variable PGHOST has a non-local server value: 127.0.0.200
```

Rather than updating this check to work for every possible scenario in Yugabyte, it is simpler to just disable the check for Yugabyte, since the new cluster creation is owned by Yugabyte anyways.
Jira: DB-14727

Test Plan:
Jenkins
```
pg15_tests/test_upgrade.sh
```

Reviewers: hsunder, fizaa

Reviewed By: hsunder

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D41041
vpatibandla-yb pushed a commit that referenced this issue Jan 16, 2025
Summary:
`check_pghost_envvar` is used by Postgres to validate that the pg server we are connecting to for upgrade to is a local server. It checks for conditions:
```
(strcmp(value, "localhost") != 0 && strcmp(value, "127.0.0.1") != 0 && strcmp(value, "::1") != 0 && !is_unixsock_path(value)))
```

However, in Yugabyte, the servers don't necessarily match this layout. `test_upgrade.sh` creates a server with IP 127.0.0.200, which causes `check_pghost_envvar` to fail with
```
+ build/latest/postgres/bin/pg_upgrade --old-datadir /tmp/pg15_cluster_data/node-1/disk-1/pg_data --old-host 127.0.0.200 --old-port 5433 --username yugabyte --check

libpq environment variable PGHOST has a non-local server value: 127.0.0.200
```

Rather than updating this check to work for every possible scenario in Yugabyte, it is simpler to just disable the check for Yugabyte, since the new cluster creation is owned by Yugabyte anyways.
Jira: DB-14727

Test Plan:
Jenkins
```
pg15_tests/test_upgrade.sh
```

Reviewers: hsunder, fizaa

Reviewed By: hsunder

Subscribers: yql

Differential Revision: https://phorge.dev.yugabyte.com/D41041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants