Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL3Fd-0005gv-S0 for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 13:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nL3Fc-00078U-ES for pgsql-general@arkaria.postgresql.org; Fri, 18 Feb 2022 13:24:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nL3Fc-00078L-1o for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 13:24:44 +0000 Received: from mail-qk1-x72b.google.com ([2607:f8b0:4864:20::72b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nL3FU-0006Vi-66 for pgsql-general@lists.postgresql.org; Fri, 18 Feb 2022 13:24:41 +0000 Received: by mail-qk1-x72b.google.com with SMTP id q4so6566458qki.11 for ; Fri, 18 Feb 2022 05:24:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:references:in-reply-to; bh=2N/XARMBJGPiQE4Ss1B+aJA7e4dpAkGHThAdxdj6XF0=; b=i+kfuoPHOcRHRKaCQUdCFJEz3Y5cyebtLggMbZvDSz6J3CtGFO+kawgf70ZuTLBjE+ Y+AvH7wUHcV7V6mZ+VvoIPx1saa3v7VwCOidSZkS5PUqag69mxy4a8fVH+IDYhDE1nNG ixToNhnEIHVaCfAwKurRqqzSiKr5BxIqgoZ9xY0ngCbiUvbuEKJrxJZSl2SKQOUvifZ3 sGPg99C2p7Qc7WuCQYPyvOSGdx4yoE8qr6MX09A4S4j8IxnTQsjD8Zif5EPa9EBOfoNE 9ENJhaFRZeT59wCpMrDt9jt+9SUq0mD38aEhGuIc8jVgSzgT1adnyzaV6P4lm3IMnNWA BZjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:references:in-reply-to; bh=2N/XARMBJGPiQE4Ss1B+aJA7e4dpAkGHThAdxdj6XF0=; b=jPoDfwDqRgxlzV+mSo1qX7BA+SQidSV5Mb1jWPDUZA1WqveWsQj2JUMONdOwWZ0DbV fba28OzBtfsBSsKdfqGVyeWWJr1lIuGlgzpTZ2w/zgzZ79G+FfaCUd0Y+aH9MZuQrKyo 8ApYsDb9CDgdQWIZMj+n8vAbqluKYlLAjCGKyjpx9mUIxGFXVZnsA1mXcWyY6pJViv7R TNprQ+stc0ngvqrcz9cwUrJsXBR5XX1o8HBPLN70DG35XIwnLIOcfXUYahLmaIOBHKNp rJvirtkXcyB3cvvXtHPt/sDjrsjEKLC+wnnG4HnUOl0bXRgbSdRVyiy/074iSeTDSZJE xPyA== X-Gm-Message-State: AOAM530JWxt+pffcyTUk2NnGIYHqlt6RPFMul8nb7RpkJgJsC+jZJIAE h1YTlpwmsZUOaq7XejVZYslA8bENJo/piQ== X-Google-Smtp-Source: ABdhPJw3RA/QR+uB6wyB1oropWxyG8+KAYTV6F5saDU0pe6Zpvt6C7mAi8liPKSdJF+9SYL35DLH0w== X-Received: by 2002:a37:4649:0:b0:47e:cf47:48af with SMTP id t70-20020a374649000000b0047ecf4748afmr4618298qka.605.1645190673492; Fri, 18 Feb 2022 05:24:33 -0800 (PST) Received: from [192.168.2.100] (pool-72-79-19-93.nwrknj.east.verizon.net. [72.79.19.93]) by smtp.gmail.com with ESMTPSA id z17sm25365848qta.11.2022.02.18.05.24.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Feb 2022 05:24:32 -0800 (PST) Content-Type: multipart/alternative; boundary="------------JRvHVh8jKpd0oI76Z2fxnYsp" Message-ID: <4b3f8e55-99ae-710b-37aa-742097961f52@gmail.com> Date: Fri, 18 Feb 2022 08:24:31 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: 2 phase commit with FDW Content-Language: en-US From: Mladen Gogala To: pgsql-general list References: In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------JRvHVh8jKpd0oI76Z2fxnYsp Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2/17/22 13:10, Mladen Gogala wrote: > > Hi! > > I am getting the following error when trying to PREPARE transaction > which updates both local and foreign table: > > 2/17/22 12:48:00:657 EST] 00000128 RegisteredRes E   WTRN0046E: An > attempt by the transaction manager to call prepare on a transactional > resource has resulted in an error. The error code was XAER_RMFAIL. The > exception stack trace follows: org.postgresql.xa.PGXAException: Error > preparing transaction. prepare xid={XidImpl: formatId(57415344), > gtrid_length(36), bqual_length(54), > data(0000017f08cc3aea00000001232c3afce8abf609478378ca6ac9d4bddbfea3e4efa55cf30000017f08cc3aea00000001232c3afce8abf609478378ca6ac9d4bddbfea3e4efa55cf3000000010000000000000000000000000002)} >         at > org.postgresql.xa.PGXAConnection.prepare(PGXAConnection.java:365) > > There are no errors is all the tables are local. It seems that > postgres_fdw is incompatible with the XA protocol. Is there a way > around it? If not, we will need yet another code change and another > data source. > > Regards > Is there anybody on this list who can tell me whether foreign tables can participate in 2-phase commit or not? My version is 14.2 on Oracle Linux 8.5. Regards -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------JRvHVh8jKpd0oI76Z2fxnYsp Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2/17/22 13:10, Mladen Gogala wrote:

Hi!

I am getting the following error when trying to PREPARE transaction which updates both local and foreign table:

2/17/22
 12:48:00:657 EST] 00000128 RegisteredRes E   WTRN0046E: An attempt by 
the transaction manager to call prepare on a transactional resource
 has resulted in an error. The error code was XAER_RMFAIL. The exception
 stack trace follows: org.postgresql.xa.PGXAException: Error preparing 
transaction. prepare xid={XidImpl: formatId(57415344), gtrid_length(36),
 bqual_length(54),
data(0000017f08cc3aea00000001232c3afce8abf609478378ca6ac9d4bddbfea3e4efa55cf30000017f08cc3aea00000001232c3afce8abf609478378ca6ac9d4bddbfea3e4efa55cf3000000010000000000000000000000000002)}
        at org.postgresql.xa.PGXAConnection.prepare(PGXAConnection.java:365)

There are no errors is all the tables are local. It seems that postgres_fdw is incompatible with the XA protocol. Is there a way around it? If not, we will need yet another code change and another data source.

Regards

Is there anybody on this list who can tell me whether foreign tables can participate in 2-phase commit or not? My version is 14.2 on Oracle Linux 8.5.

Regards


-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
--------------JRvHVh8jKpd0oI76Z2fxnYsp--