Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Re: [HACKERS] A weird bit in pg_upgrade/exec.c - Mailing list pgsql-hackers

From a.akenteva@postgrespro.ru
Subject Re: [HACKERS] A weird bit in pg_upgrade/exec.c
Date
Msg-id ba81b93e77c4bc1778ae6f0def7be883@postgrespro.ru
Whole thread Raw
In response to Re: [HACKERS] A weird bit in pg_upgrade/exec.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] A weird bit in pg_upgrade/exec.c
List pgsql-hackers
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.
Attachment

pgsql-hackers by date:

Previous
From: Rafia Sabih
Date:
Subject: Re: [HACKERS] [POC] Faster processing at Gather node
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] ginInsertCleanup called from vacuum could still misstuples to be deleted