mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
postgres_fdw: Add support for parallel abort.
postgres_fdw aborts remote (sub)transactions opened on remote server(s) in a local (sub)transaction one by one when the local (sub)transaction aborts. This patch allows it to abort the remote (sub)transactions in parallel to improve performance. This is enabled by the server option "parallel_abort". The default is false. Etsuro Fujita, reviewed by David Zhang. Discussion: http://postgr.es/m/CAPmGK15FuPVGx3TGHKShsbPKKtF1y58-ZLcKoxfN-nqLj1dZ%3Dg%40mail.gmail.com
This commit is contained in:
@ -3899,10 +3899,12 @@ DROP FOREIGN TABLE remote_application_name;
|
||||
DROP VIEW my_application_name;
|
||||
|
||||
-- ===================================================================
|
||||
-- test parallel commit
|
||||
-- test parallel commit and parallel abort
|
||||
-- ===================================================================
|
||||
ALTER SERVER loopback OPTIONS (ADD parallel_commit 'true');
|
||||
ALTER SERVER loopback OPTIONS (ADD parallel_abort 'true');
|
||||
ALTER SERVER loopback2 OPTIONS (ADD parallel_commit 'true');
|
||||
ALTER SERVER loopback2 OPTIONS (ADD parallel_abort 'true');
|
||||
|
||||
CREATE TABLE ploc1 (f1 int, f2 text);
|
||||
CREATE FOREIGN TABLE prem1 (f1 int, f2 text)
|
||||
@ -3941,8 +3943,31 @@ COMMIT;
|
||||
SELECT * FROM prem1;
|
||||
SELECT * FROM prem2;
|
||||
|
||||
BEGIN;
|
||||
INSERT INTO prem1 VALUES (105, 'test1');
|
||||
INSERT INTO prem2 VALUES (205, 'test2');
|
||||
ABORT;
|
||||
SELECT * FROM prem1;
|
||||
SELECT * FROM prem2;
|
||||
|
||||
-- This tests executing DEALLOCATE ALL against foreign servers in parallel
|
||||
-- during post-abort
|
||||
BEGIN;
|
||||
SAVEPOINT s;
|
||||
INSERT INTO prem1 VALUES (105, 'test1');
|
||||
INSERT INTO prem2 VALUES (205, 'test2');
|
||||
ROLLBACK TO SAVEPOINT s;
|
||||
RELEASE SAVEPOINT s;
|
||||
INSERT INTO prem1 VALUES (105, 'test1');
|
||||
INSERT INTO prem2 VALUES (205, 'test2');
|
||||
ABORT;
|
||||
SELECT * FROM prem1;
|
||||
SELECT * FROM prem2;
|
||||
|
||||
ALTER SERVER loopback OPTIONS (DROP parallel_commit);
|
||||
ALTER SERVER loopback OPTIONS (DROP parallel_abort);
|
||||
ALTER SERVER loopback2 OPTIONS (DROP parallel_commit);
|
||||
ALTER SERVER loopback2 OPTIONS (DROP parallel_abort);
|
||||
|
||||
-- ===================================================================
|
||||
-- test for ANALYZE sampling
|
||||
|
Reference in New Issue
Block a user