From: digoal@126.com
To: pgsql-bugs@postgresql.org
Subject: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
Date: Mon, 15 Jun 2015 09:05:23 +0000
Message-ID: <20150615090523.2735.53140@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: 13443
Logged by: digoal
Email address: digoal@126.com
PostgreSQL version: Unsupported/Unknown
Operating system: CentOS 6.x x64
Description:
http://www.postgresql.org/docs/devel/static/warm-standby.html#STREAMING-REPLICATION
25.2.6. Replication Slots
Replication slots provide an automated way to ensure that the master does
not remove WAL segments until they have been received by all standbys, and
that the master does not remove rows which could cause a recovery conflict
even when the standby is disconnected.
In my test, master will remove rows when standby disconnect.
standby:
postgres=# begin transaction isolation level repeatable read ;
BEGIN
postgres=# select * from test;
id
----
1
1
1
1
1
(5 rows)
master:
delete from test;
postgres=# vacuum verbose test;
INFO: vacuuming "public.test"
INFO: "test": found 0 removable, 5 nonremovable row versions in 1 out of 1
pages
DETAIL: 5 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
VACUUM
but when i stop standby:
pg95@db-172-16-3-150-> pg_ctl stop -m immediate -D
/data03/pg95_stdby/pg_root
waiting for server to shut down.... done
server stopped
the deadtuple will removes.
postgres=# vacuum verbose test;
INFO: vacuuming "public.test"
INFO: "test": removed 5 row versions in 1 pages
INFO: "test": found 5 removable, 0 nonremovable row versions in 1 out of 1
pages
DETAIL: 0 dead row versions cannot be removed yet.
There were 0 unused item pointers.
Skipped 0 pages due to buffer pins.
0 pages are entirely empty.
CPU 0.00s/0.00u sec elapsed 0.00 sec.
INFO: "test": truncated 1 to 0 pages
DETAIL: CPU 0.00s/0.00u sec elapsed 0.03 sec.
VACUUM
--
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: digoal@126.com
Subject: Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
In-Reply-To: <20150615090523.2735.53140@wrigleys.postgresql.org>
References: <20150615090523.2735.53140@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