Re: [HACKERS] A weird bit in pg_upgrade/exec.c
Anna Akenteva <a.akenteva@postgrespro.ru>
From: a.akenteva@postgrespro.ru
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org, pgsql-hackers-owner@postgresql.org
Date: 2017-11-16T12:05:59Z
Lists: pgsql-hackers
Attachments
- Fixed-exec-c.patch (text/x-diff) patch
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Yeah, the way it is now seems outright broken. It will try to do
> get_bin_version on the new cluster before having done validate_exec
> there, violating its own comment.
>
> I think we should change this as a bug fix, independently of whatever
> else you had in mind to do here.
I see this bug is now fixed in pg_upgrade/exec.c => check_bin_dir().
There's another bit exactly like that in check_data_dir() though.
We use global variables instead of using the argument passed to the
function,
which makes the function not reusable. Sorry if I mentioned it too
vaguely
in the previous letter.
I attached a patch with the change that would fix it.
In pg_upgrade/exec.c => check_data_dir() I substituted these two lines
old_cluster.major_version = get_major_server_version(&old_cluster);
new_cluster.major_version = get_major_server_version(&new_cluster);
with this line:
cluster->major_version = get_major_server_version(cluster);
and changed the comment accordingly.
Commits
-
Fix bogus logic for checking data dirs' versions within pg_upgrade.
- 4b02e935fee8 10.2 landed
- 164d6338785b 11.0 landed
-
Fix bogus logic for checking executables' versions within pg_upgrade.
- 115a70756338 10.2 landed
- 9be95ef156e7 11.0 landed