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.