Re: Transactions involving multiple postgres foreign servers

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Transactions involving multiple postgres foreign servers
Date: 2015-08-03 04:05:27
Message-ID: CAA4eK1Jk5Tqj0n+=h6BQRnDQdye4aqBpjiQKrYK57bD6WngLVw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 9, 2015 at 3:48 PM, Ashutosh Bapat <
ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
>
> 2. New catalog - This method takes out the need to have separate method for
>>> C1, C5 and even C2, also the synchronization will be taken care of by row
>>> locks, there will be no limit on the number of foreign transactions as
>>> well
>>> as the size of foreign prepared transaction information. But big problem
>>> with this approach is that, the changes to the catalogs are atomic with
>>> the
>>> local transaction. If a foreign prepared transaction can not be aborted
>>> while the local transaction is rolled back, that entry needs to retained.
>>> But since the local transaction is aborting the corresponding catalog
>>> entry
>>> would become invisible and thus unavailable to the resolver (alas! we do
>>> not have autonomous transaction support). We may be able to overcome
>>> this,
>>> by simulating autonomous transaction through a background worker (which
>>> can
>>> also act as a resolver). But the amount of communication and
>>> synchronization, might affect the performance.
>>>
>>
>> Or you could insert/update the rows in the catalog with xmin=FrozenXid,
>> ignoring MVCC. Not sure how well that would work.
>>
>
> I am not aware how to do that. Do we have any precedence in the code.
> Something like a reference implementation, which I can follow.
>

Does some thing on lines of Copy Freeze can help here?

However if you are going to follow this method, then I think you
need to also ensure when and how to clear those rows after
rollback is complete or once resolver has resolved those prepared
foreign transactions.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Rajeev rastogi 2015-08-03 04:37:56 Re: Autonomous Transaction is back
Previous Message 高增琦 2015-08-03 04:03:55 Re: buffer locking fix for lazy_scan_heap