Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot - Mailing list pgsql-bugs

From zhangjinyu
Subject Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
Date
Msg-id 1439552734803-5862147.post@n5.nabble.com
Whole thread Raw
In response to Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot  (Haribabu Kommi <kommi.haribabu@gmail.com>)
Responses Re: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The test cases is not clear in last mail,  the following shows all test
cases.
1. Table precondition
create table t(c1 int);
create table t2(c1 int):
insert into t values(1),(2),(3);
select xmin from t ;   (xmin=10043)
2. Step1:
   session1:  begin transaction isolation level repeatable read;
                 select * from t2;   (query on other table only for get
snapshot)
   Step2:
  session2: alter table t alter c1 set data type char(10);
               select xmin from t;   (new xid)
   Step3:
  session1:  select xmin from t;       (you can see 0 row, because the
snapshot is the same as the first query when transaction isolation level is
repeatable read.)

The DDL query(alter ...set data type ) rewrites all tuples with new
transaction xid,  so if the transaction isolation level is repeatable read,
that will cause wrong result.   Which DDL query rewrite all tuples with new
xid?




--
View this message in context:
http://postgresql.nabble.com/BUG-13541-There-is-a-visibility-issue-when-run-some-DDL-and-Query-The-time-window-is-very-shot-tp5861304p5862147.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

pgsql-bugs by date:

Previous
From: Greg Stark
Date:
Subject: Re: BUG #13559: WAL replay stuck after DROP VIEW
Next
From: feikesteenbergen@gmail.com
Date:
Subject: BUG #13571: sql-only extension segfaults backend during creation