public inbox for [email protected]
help / color / mirror / Atom feedFrom: Haribabu Kommi <[email protected]>
To: [email protected]
Cc: [email protected] <[email protected]>
Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
Date: Tue, 11 Aug 2015 17:41:15 +1000
Message-ID: <CAJrrPGd--dTUoRpwiSmNVpa56sbCMMB-xB4=Qc4um1NNnt4uhQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
List-Unsubscribe: <mailto:[email protected]?body=unsub%20pgsql-bugs>
On Fri, Aug 7, 2015 at 10:16 PM, <[email protected]> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 13541
> Logged by: zhangjinyu
> Email address: [email protected]
> 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;
I am not able to reproduce this issue.
I tried putting a breakpoint after GetTransactionSnapshot function
in exec_simple_query function and executed the alter table in other session.
Even if the other session data is committed, still the old data is
present in the
database. The old transaction still can see this data. Am I missing something?
Regards,
Hari Babu
Fujitsu Australia
--
Sent via pgsql-bugs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
view thread (4+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: BUG #13541: There is a visibility issue when run some DDL and Query. The time window is very shot
In-Reply-To: <CAJrrPGd--dTUoRpwiSmNVpa56sbCMMB-xB4=Qc4um1NNnt4uhQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox