Closed
Description
Hi
when I tested the builting pool, I found a dirty reading
The test scenario is :
1. pool setting
session_pool_size = 1
session_pool_ports = 1
2. session A
- update data and not commit,exiting the session A
[postgres@builtin_pool ~]$ psql -d test -p 5433
psql (11devel)
Type "help" for help.
test=# create table tbl1(id int);
CREATE TABLE
test=# insert into tbl1 select 1;
INSERT 0 1
test=# begin ;
BEGIN
test=# update tbl1 set id = 2;
UPDATE 1
test=# \q
[postgres@builtin_pool ~]$
3. session B
connect to the test database in session B ,you can see the data of an uncommitted transaction in session A,and can commit the transaction !!!
[postgres@builtin_pool pgdata]$ psql -p 5433 -d test
psql (11devel)
Type "help" for help.
test=# select * from tbl1 ;
id
----
2
(1 row)
test=# end;
COMMIT
4. session B
update data not commit , exit the session B
test=# begin ;
BEGIN
test=# update tbl1 set id = 3;
UPDATE 1
test=# select * from tbl1;
id
----
3
(1 row)
test=#
test=#
test=# \q
5. session A
Connect to another database in session A
[postgres@builtin_pool ~]$ psql -d postgres -p 5433
psql: FATAL: Failed to open session (dbname=postgres user=postgres) in backend 25752 (dbname=test user=postgres)
6. session B
the not commit transaction is rollback
[postgres@builtin_pool pgdata]$ psql -p 5433 -d test
psql (11devel)
Type "help" for help.
test=# select * from tbl1;
id
----
2
(1 row)
test=# end;
WARNING: there is no transaction in progress
COMMIT
Metadata
Metadata
Assignees
Labels
No labels