View Issue Details

IDProjectCategoryView StatusLast Update
0000323Pgpool-IIBugpublic2017-08-29 09:29
Reporterhwi Assigned Tot-ishii  
PriorityurgentSeveritymajorReproducibilityalways
Status closedResolutionopen 
PlatformLinuxOSCentosOS Version7.3.1611
Product Version3.6.4 
Summary0000323: After error : the connection is marked as "idle in transaction (aborted)"
DescriptionWe use tomcat with pgpool for loadbalancing and postgresql 9.6.3 actif/passif.

When an error occur the connection is marked as "idle in transaction (aborted)", I created a test case, it's ok when to test directly to database on port 5432.

I tested with pgpool 3.6.1, it's good. I think it's the same problem : ticket 0000318: Exception in plpgsql function is not passed to application
Steps To ReproduceTest case :
CREATE TABLE
    "user" (id text, "name" text, primary key(id)) ;
CREATE TABLE
    "login" (id serial, auth_id text, user_id text references "user"(id), primary key(id));

-- This transaction block will work
BEGIN;
  INSERT INTO "user"(id, "name") VALUES ('ce1b346cf35493d30', 'John Doe');
  INSERT INTO login(auth_id, user_id) VALUES ('123456', 'ce1b346cf35493d30') RETURNING id;
COMMIT;

-- Relauch this , an error occur duplicate key

test=# BEGIN;
BEGIN
test=# INSERT INTO "user"(id, "name") VALUES ('strangeid', 'Nick');
ERROR: duplicate key value violates unique constraint "user_pkey"
DÉTAIL : Key (id)=(strangeid) already exists.
test=# INSERT INTO login(auth_id, user_id) VALUES ('56789', 'ce1b346cf35493d30') RETURNING id;
ERROR: current transaction is aborted, commands ignored until end of transaction block
test=# COMMIT;
COMMIT

We don't have rollback.

With pgpool 3.6.1 :

test=# BEGIN;
BEGIN
test=# INSERT INTO "user"(id, "name") VALUES ('strangeid', 'Nick');
ERROR: duplicate key value violates unique constraint "user_pkey"
DÉTAIL : Key (id)=(strangeid) already exists.
test=# INSERT INTO login(auth_id, user_id) VALUES ('56789', 'ce1b346cf35493d30') RETURNING id;
ERROR: current transaction is aborted, commands ignored until end of transaction block
test=# COMMIT;
ROLLBACK
Tagspgpool

Activities

t-ishii

2017-07-21 07:58

developer   ~0001596

Did not reproduce here.
t-ishii@localhost: psql -e -p 11000 test
Pager usage is off.
psql (9.6.3)
Type "help" for help.

test=# show pool_version;
show pool_version;
    pool_version
---------------------
 3.6.4 (subaruboshi)
(1 row)

test=# \i /tmp/b.sql
BEGIN;
BEGIN
INSERT INTO "user"(id, "name") VALUES ('ce1b346cf35493d30', 'John Doe');
psql:/tmp/b.sql:2: ERROR: duplicate key value violates unique constraint "user_pkey"
DETAIL: Key (id)=(ce1b346cf35493d30) already exists.
INSERT INTO login(auth_id, user_id) VALUES ('123456', 'ce1b346cf35493d30')
RETURNING id;
psql:/tmp/b.sql:4: ERROR: current transaction is aborted, commands ignored until end of transaction block
COMMIT;
ROLLBACK
test=#

Issue History

Date Modified Username Field Change
2017-07-20 17:30 hwi New Issue
2017-07-20 17:30 hwi Tag Attached: pgpool
2017-07-21 07:58 t-ishii Note Added: 0001596
2017-07-21 07:59 t-ishii Assigned To => t-ishii
2017-07-21 07:59 t-ishii Status new => feedback
2017-08-29 09:29 pengbo Status feedback => closed