RE: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-22 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, Thank you for reviewing! New patch can be available in [1]. > We can update the commit message with the details of the same, it will > help to understand that it is intentionally done. Both comments and a commit message were updated related. > There are couple of typos with the ne

RE: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-22 Thread Hayato Kuroda (Fujitsu)
Dear Alvaro, Thank you for updating! PSA new version. > Note that this patch falsifies the comment in SetNextObjectId that > taking the lock is pro forma only -- it no longer is, since in upgrade > mode there can be multiple subprocesses running -- so I think it should > be updated. Indeed, some

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-18 Thread vignesh C
On Mon, 16 Oct 2023 at 10:33, Hayato Kuroda (Fujitsu) wrote: > > Dear Vignesh, > > Thank you for reviewing! PSA new version. > > > > > Few comments: > > 1) Most of the code in binary_upgrade_set_next_oid is similar to > > SetNextObjectId, but SetNextObjectId has the error handling to report > > an

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-18 Thread Alvaro Herrera
Note that this patch falsifies the comment in SetNextObjectId that taking the lock is pro forma only -- it no longer is, since in upgrade mode there can be multiple subprocesses running -- so I think it should be updated. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB

RE: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-15 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, Thank you for reviewing! PSA new version. > > Few comments: > 1) Most of the code in binary_upgrade_set_next_oid is similar to > SetNextObjectId, but SetNextObjectId has the error handling to report > an error if an invalid nextOid is specified: > if (ShmemVariableCache->nextOid >

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-15 Thread vignesh C
On Fri, 13 Oct 2023 at 17:15, Hayato Kuroda (Fujitsu) wrote: > > Dear hackers, > > > > > > > > > I mean instead of resetwal directly modifying the control file we > > > > > will modify that value in the server using the binary_upgrade function > > > > > and then have that value flush to the disk

RE: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-13 Thread Hayato Kuroda (Fujitsu)
Dear hackers, > > > > > > I mean instead of resetwal directly modifying the control file we > > > > will modify that value in the server using the binary_upgrade function > > > > and then have that value flush to the disk by shutdown checkpoint. > > > > > > > > > > True, the alternative to consid

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-13 Thread Amit Kapila
On Fri, Oct 13, 2023 at 2:03 PM Dilip Kumar wrote: > > On Fri, Oct 13, 2023 at 11:07 AM Amit Kapila wrote: > > > > > But is this a problem? basically, we will set the > > > ShmemVariableCache->nextOid counter to the value that we want in the > > > IsBinaryUpgrade-specific function. And then the

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-13 Thread Dilip Kumar
On Fri, Oct 13, 2023 at 11:07 AM Amit Kapila wrote: > > > But is this a problem? basically, we will set the > > ShmemVariableCache->nextOid counter to the value that we want in the > > IsBinaryUpgrade-specific function. And then the shutdown checkpoint > > will flush that value to the control fil

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-12 Thread Amit Kapila
On Fri, Oct 13, 2023 at 10:37 AM Dilip Kumar wrote: > > On Fri, Oct 13, 2023 at 9:29 AM Amit Kapila wrote: > > > > On Fri, Oct 13, 2023 at 12:00 AM Robert Haas wrote: > > > > > > On Thu, Oct 12, 2023 at 7:17 AM Amit Kapila > > > wrote: > > > > Now, as mentioned in the first paragraph, it seems

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-12 Thread Dilip Kumar
On Fri, Oct 13, 2023 at 9:29 AM Amit Kapila wrote: > > On Fri, Oct 13, 2023 at 12:00 AM Robert Haas wrote: > > > > On Thu, Oct 12, 2023 at 7:17 AM Amit Kapila wrote: > > > Now, as mentioned in the first paragraph, it seems we anyway don't > > > need to reset the WAL at the end when setting the n

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-12 Thread Amit Kapila
On Fri, Oct 13, 2023 at 12:00 AM Robert Haas wrote: > > On Thu, Oct 12, 2023 at 7:17 AM Amit Kapila wrote: > > Now, as mentioned in the first paragraph, it seems we anyway don't > > need to reset the WAL at the end when setting the next OID for the new > > cluster with the -o option. If that is t

Re: pg_upgrade's interaction with pg_resetwal seems confusing

2023-10-12 Thread Robert Haas
On Thu, Oct 12, 2023 at 7:17 AM Amit Kapila wrote: > Now, as mentioned in the first paragraph, it seems we anyway don't > need to reset the WAL at the end when setting the next OID for the new > cluster with the -o option. If that is true, then I think even without > slots work it will be helpful