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 1nKlEy-0001LD-EP for pgsql-general@arkaria.postgresql.org; Thu, 17 Feb 2022 18:10:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKlEw-0001Pl-Vn for pgsql-general@arkaria.postgresql.org; Thu, 17 Feb 2022 18:10:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nKlEw-0001Pc-JL for pgsql-general@lists.postgresql.org; Thu, 17 Feb 2022 18:10:50 +0000 Received: from mail-qv1-xf2e.google.com ([2607:f8b0:4864:20::f2e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nKlEu-0003s2-2a for pgsql-general@lists.postgresql.org; Thu, 17 Feb 2022 18:10:49 +0000 Received: by mail-qv1-xf2e.google.com with SMTP id a19so9894803qvm.4 for ; Thu, 17 Feb 2022 10:10:47 -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:to:content-language:from :subject; bh=VL2WK9w9rQSgYwGlFcfomotNXO0EY/U3lmMnrperoAA=; b=ZU0KeG6vcP1OQ4KDmnAPsWmwf7TDgl7/v+fl+TuXPw9swu2k2ex/J3r+qCZL+NnqCA 8NcdIRzigeORzK+eZ0PErU0gJ55fi8OuYh9G3IumYwOvHXfhV9cwERo5JMFbzEtTy3gS RKwLnDd7d8UIZgbw2zsLxLO6nf8IHC9DigemWceJhy2TC79FDn1UG5nXkYDFB6OJ4LeT /5UXdWQmhoseRf/hLTQ30LMZXJ2wl0RtTKzzanfIhjyVzh4LYvYO6gbr9Ovr6YIOSX1r oT7oAQBHDH/IxuhgUD7bCFxhzBfm2wepHOY9jj1+9y7K5uURlHvN/WsNqgk8mxhOOHOd YZMA== 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:to :content-language:from:subject; bh=VL2WK9w9rQSgYwGlFcfomotNXO0EY/U3lmMnrperoAA=; b=tJAI9C/UDDsQQeEOAaRBQ93YmlmpnlLbh2MvsTv8yIKPf/cRwr5+nJXevg23NRSeI0 NVSXOw7hnGoCEAHnvwC1VCBYAW8DV3yAXbu+lbjzhn9/Z+lKlXFqboGurp5aNdXBl7/8 yMmZJmj05gp6FwhIMreTbKcLXzGd+KEkLelujmDCo1267fGTuHF4w3wZUNNX2Iyu78la kUlOKPWqKkLZPVLNLnul2NUhBCb+sRwSaohDdM/nCFfhI4Qkb8nz3PtX6F4KGqgTWziP CdSCptzGeH+0FGIIQ+zEuIjxzjCvf5LS3/I8tYB9FNLGlsFe+O5inTCagvWG8bTov4NG bB0w== X-Gm-Message-State: AOAM533y+SYsw9MDZ0U8zzPGnCDeBHrLk/5ytlMzyKz46FJi9Uo/cjDJ sKBfi30Skhazel7yvoerjqgtgcQDHa0V9Q== X-Google-Smtp-Source: ABdhPJy8zx15Tj+dE/XqGmYTVy1HG8d9ZMwNq1p2e8g5RpxQPdRH5Wy7TprgLPI/HXbGhA6piC85EQ== X-Received: by 2002:ac8:5ace:0:b0:2c9:f9d2:146 with SMTP id d14-20020ac85ace000000b002c9f9d20146mr3666108qtd.216.1645121445651; Thu, 17 Feb 2022 10:10:45 -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 y20sm23653586qtw.28.2022.02.17.10.10.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Feb 2022 10:10:44 -0800 (PST) Content-Type: multipart/alternative; boundary="------------UivlokB8hpvDsOYo0CVInk0a" Message-ID: Date: Thu, 17 Feb 2022 13:10:43 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: pgsql-general list Content-Language: en-US From: Mladen Gogala Subject: 2 phase commit with FDW 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. --------------UivlokB8hpvDsOYo0CVInk0a Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------UivlokB8hpvDsOYo0CVInk0a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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

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