BUG #13443: master will remove dead rows when hot standby(use slot) disconnect

Поиск
Список
Период
Сортировка
От digoal@126.com
Тема BUG #13443: master will remove dead rows when hot standby(use slot) disconnect
Дата
Msg-id 20150615090523.2735.53140@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: sergi.casbas@iris.cat
Дата:
Сообщение: BUG #13444: psql can't recover a pg_dump.
Следующее
От: Michael Meskes
Дата:
Сообщение: Re: Lack of Sanity Checking in file 'misc.c' for PostgreSQL 9.4.x