Menu

#47 Postgres-XL bug in transaction isolation with repeatable read

9.2rc
open
nobody
1
None
nobody
2014-12-26
2014-12-26
Kaijiang
No

I'm using (PGXL 9.2.0, based on PG 9.2.4 (Postgres-XL 9.2.0)) on CentOS 6.2. I created 1 coordinator (cd1) and 2 data nodes (dn1 & dn2).

I got very weird results under 'repeatable read' isolation level:

REPRO:

I open 2 sessions to connect to postgres-XL and update the same tuple in 2 sessions. At some point, I got an extra tuple! My commands and the screen outputs are listed below:

*In Session 1***

set default_transaction_isolation='repeatable read';

*In Session 2***

set default_transaction_isolation='repeatable read';

*In Session 1***

postgres=# create table t2 (f1 int, f2 int) to node(dn2);
CREATE TABLE
Time: 30.144 ms
postgres=# insert into t2 values (11,12);
INSERT 0 1
Time: 5.047 ms
postgres=# begin;
BEGIN
Time: 0.215 ms
postgres=# select * from t2;
f1 | f2
----+----
11 | 12
(1 row)

Time: 2.494 ms

*In Session 2***

postgres=# begin;
BEGIN
Time: 0.302 ms
postgres=# select * from t2;
f1 | f2
----+----
11 | 12
(1 row)

Time: 3.257 ms
postgres=# update t2 set f2=f2+1000 where f1=11;
UPDATE 1
Time: 3686.544 ms
postgres=# commit;
COMMIT
Time: 1.468 ms

*In Session 1***

postgres=# select * from t2;
f1 | f2
----+------
11 | 12
11 | 1112
(2 rows)

Time: 1.235 ms

Very weird result!!! I did NOT insert any new tuple (only update on the existing tuple) but I got an extra tuple (the 2nd tuple in the above result list)?

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.