Skip to content

dirty reading in builting pool #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nemoaa opened this issue Jul 25, 2018 · 4 comments
Closed

dirty reading in builting pool #8

nemoaa opened this issue Jul 25, 2018 · 4 comments

Comments

@nemoaa
Copy link

nemoaa commented Jul 25, 2018

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

@knizhnik
Copy link

Thank you for reporting the problem,
Quit command was not correctly handled: it does't abort current transaction.
Fixed by commit a795247

@nemoaa
Copy link
Author

nemoaa commented Jul 26, 2018

Hi!
thank you,please check the issue step 4,step 5 and step 6's problem!

@knizhnik
Copy link

Sorry, it is known limitation: it is possible to connect to each session pool (port) only using one database/user pair. Attempt to connect using some other database will cause "Failed to open session" error.

@nemoaa
Copy link
Author

nemoaa commented Jul 26, 2018

ok,thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants