pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #14361: snapshot too old bug? in xmin>=xid transaction, also raise snapshot too old error
2+ messages / 2 participants
[nested] [flat]
* BUG #14361: snapshot too old bug? in xmin>=xid transaction, also raise snapshot too old error
@ 2016-10-07 15:03 digoal@126.com
2016-10-07 21:24 ` Re: BUG #14361: snapshot too old bug? in xmin>=xid transaction, also raise snapshot too old error Kevin Grittner <kgrittn@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: digoal@126.com @ 2016-10-07 15:03 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 14361
Logged by: Zhou Digoal
Email address: digoal@126.com
PostgreSQL version: 9.6.0
Operating system: CentOS 6.x x64
Description:
create table tbl1(id int);
insert into tbl1 values (1);
session a:
postgres=# begin;
BEGIN
postgres=# insert into tbl1 values (2); -- generate xid, then vacuum cann't
reclaim dead tuple after this xid.
INSERT 0 1
postgres=# with t as(select pg_sleep(100)) select * from tbl1,t; -- emulate
a long query, it will visite dirty page after this query's snapshot->lsn.
then , quick , generate a new lsn dirty page.
session b:
postgres=# update tbl1 set id=3;
-- vacuum have not reclaim the deadtuple, but session a raise error the
same.
session a:
ERROR: snapshot too old
It's not perfect.
best regards,
digoal
```
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #14361: snapshot too old bug? in xmin>=xid transaction, also raise snapshot too old error
2016-10-07 15:03 BUG #14361: snapshot too old bug? in xmin>=xid transaction, also raise snapshot too old error digoal@126.com
@ 2016-10-07 21:24 ` Kevin Grittner <kgrittn@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Grittner @ 2016-10-07 21:24 UTC (permalink / raw)
To: digoal@126.com; +Cc: pgsql-bugs
On Fri, Oct 7, 2016 at 10:03 AM, <digoal@126.com> wrote:
> create table tbl1(id int);
> insert into tbl1 values (1);
>
> session a:
> postgres=# begin;
> BEGIN
> postgres=# insert into tbl1 values (2); -- generate xid, then vacuum cann't
> reclaim dead tuple after this xid.
> INSERT 0 1
> postgres=# with t as(select pg_sleep(100)) select * from tbl1,t; -- emulate
> a long query, it will visite dirty page after this query's snapshot->lsn.
>
>
> then , quick , generate a new lsn dirty page.
> session b:
> postgres=# update tbl1 set id=3;
>
>
> -- vacuum have not reclaim the deadtuple, but session a raise error the
> same.
> session a:
> ERROR: snapshot too old
>
> It's not perfect.
To recap the above: when a snapshot is in use long enough to be
past the old_snapshot_threshold it will generate a "snapshot too
old" error when it accesses a page modified since the snapshot was
taken -- whether or not the modification was caused by early
cleanup of data.
True, and not a bug. In fact, this is not dissimilar to the
situation that can occur in some other DBMS when the rollback log
is purged. There is not a risk of seeing incorrect results to your
query; but if the snapshot gets too old, there is indeed a risk of
getting a "snapshot too old" error even if keeping infinite data on
what modified which pages would allow the DBMS to know that it is
OK to allow the query to proceed without risk of incorrect results.
The point is to allow cleanup of exactly the information that
would *tell* you that it is OK to proceed without error.
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-10-07 21:24 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 15:03 BUG #14361: snapshot too old bug? in xmin>=xid transaction, also raise snapshot too old error digoal@126.com
2016-10-07 21:24 ` Kevin Grittner <kgrittn@gmail.com>
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