From: beijing_pg@163.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
Date: Fri, 07 Aug 2015 12:16:43 +0000
Message-ID: <20150807121643.32633.60549@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 13541
Logged by: zhangjinyu
Email address: beijing_pg@163.com
PostgreSQL version: 9.2.13
Operating system: suse
Description:
There is a visibility issue when run some DDL and Query. The time window is
very shot. Postgres is to hold relation lock after getsnapshot. Before a
query holds relation lock, if another session run a DDL(alter table alter
column set datatype), Once this DDL committed, select query will return zero
row, because the DDL(alter table alter column set datatype) will rewrite all
tuples with new transaction id.
We can use the following test case to repro the issue. we add sleep(40)
after GetTransactionSnapshot (in function exec_simple_query) to enlarge the
time window.
Step1: session1: select * from t; (return 3 row)
set enable_sleep30_after_getsnapshot=on;
select * from t;
Step2: session2: begin transaction;
alter table t alter c1 set type char(10);
commit;
we can see session1 "select * from t" return 0 row.
======================================
session1:
select * from t; (it returns 3 rows)
set enable_sleep30_after_getsnapshot=on;
select * from t; (it returns 0 row)
session2:
start transaction;
alter table t alter c1 set type char(10);
end;
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: beijing_pg@163.com
Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
In-Reply-To: <20150807121643.32633.60549@wrigleys.postgresql.org>
References: <20150807121643.32633.60549@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox