Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4TVM-00016q-6m for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Jun 2015 12:28:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z4TVL-0003bB-M7 for pgsql-bugs@arkaria.postgresql.org; Mon, 15 Jun 2015 12:28:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z4QLP-0005ce-0Z for pgsql-bugs@postgresql.org; Mon, 15 Jun 2015 09:06:15 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Z4QLF-0001Nd-Ml for pgsql-bugs@postgresql.org; Mon, 15 Jun 2015 09:06:13 +0000 MIME-Version: 1.0 Subject: BUG #13443: master will remove dead rows when hot standby(use slot) disconnect To: pgsql-bugs@postgresql.org From: digoal@126.com Date: Mon, 15 Jun 2015 09:05:23 +0000 Message-ID: <20150615090523.2735.53140@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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