Re: bug in update tuple routing with foreign partitions - Mailing list pgsql-hackers

From Etsuro Fujita
Subject Re: bug in update tuple routing with foreign partitions
Date
Msg-id 5CB93D3F.6050903@lab.ntt.co.jp
Whole thread Raw
In response to Re: bug in update tuple routing with foreign partitions  (Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>)
List pgsql-hackers
(2019/04/18 22:10), Etsuro Fujita wrote:
> Notes:
>
> * I kept all the changes in the previous patch, because otherwise
> postgres_fdw would fail to release resources for a foreign-insert
> operation created by postgresBeginForeignInsert() for a tuple-routable
> foreign table (ie, a foreign-table subplan resultrel that has been
> updated already) during postgresEndForeignInsert().

I noticed that this explanation was not right.  Let me correct myself. 
The reason why I kept those changes is: without those changes, we would 
fail to release the resources for a foreign-update operation (ie, 
fmstate) created by postgresBeginForeignModify(), replaced by the 
fmstate for the foreign-insert operation, because when doing 
ExecEndPlan(), we first call postgresEndForeignModify() and then call 
postgresEndForeignInsert(); so, if we didn't keep those changes, we 
would *mistakenly* release the fmstate for the foreign-insert operation 
in postgresEndForeignModify(), and we wouldn't do anything about the 
fmstate for the foreign-update operation in that function and in the 
subsequent postgresEndForeignInsert().

Best regards,
Etsuro Fujita




pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Pathological performance when inserting many NULLs into a unique index
Next
From: Paul Guo
Date:
Subject: Re: Two pg_rewind patches (auto generate recovery conf and ensureclean shutdown)