Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VvAX8-00072w-P9 for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Dec 2013 18:47:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VvAX8-0005hX-93 for pgsql-bugs@arkaria.postgresql.org; Mon, 23 Dec 2013 18:47:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv20n-0000rW-NY for pgsql-bugs@postgresql.org; Mon, 23 Dec 2013 09:41:21 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv20i-0006od-9p for pgsql-bugs@postgresql.org; Mon, 23 Dec 2013 09:41:21 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Vv20f-0002dY-4o for pgsql-bugs@postgresql.org; Mon, 23 Dec 2013 09:41:15 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1Vv20Z-0005H0-QA for pgsql-bugs@postgresql.org; Mon, 23 Dec 2013 09:41:07 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8697: checkpoint cann't flush unlogged table's dirty page to disk. To: pgsql-bugs@postgresql.org From: digoal@126.com Message-Id: Date: Mon, 23 Dec 2013 09:41:07 +0000 X-Pg-Spam-Score: -2.5 (--) 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: 8697 Logged by: digoal.zhou Email address: digoal@126.com PostgreSQL version: 9.3.2 Operating system: CentOS 5.x x64 Description: checkpoint cann't flush unlogged table's dirty page to disk. digoal=# create table u(id int); CREATE TABLE -- update table u to unlogged table -- and insert some data digoal=# update pg_class set relpersistence ='u' where relname='u'; UPDATE 1 digoal=# insert into u select generate_series(1,100000); INSERT 0 100000 -- then query the file stats. digoal=# select * from pg_stat_file(pg_relation_filepath('u')), pg_relation_filepath('u'); size | access | modification | change | creation | isdir | pg_relation_filepath ---------+------------------------+------------------------+------------------------+----------+-------+---------------------- 3629056 | 2013-12-23 17:36:54+08 | 2013-12-23 17:37:02+08 | 2013-12-23 17:37:02+08 | | f | base/16399/122891 (1 row) -- then checkpoint, digoal=# checkpoint; CHECKPOINT -- and then query the file stats , -- we can see the stats no change. -- so checkpoint cann't flush unlogged table's dirty page. digoal=# select * from pg_stat_file(pg_relation_filepath('u')), pg_relation_filepath('u'); size | access | modification | change | creation | isdir | pg_relation_filepath ---------+------------------------+------------------------+------------------------+----------+-------+---------------------- 3629056 | 2013-12-23 17:36:54+08 | 2013-12-23 17:37:02+08 | 2013-12-23 17:37:02+08 | | f | base/16399/122891 (1 row) -- then change table u to normal table digoal=# update pg_class set relpersistence ='p' where relname='u'; UPDATE 1 -- then insert some data to u digoal=# insert into u select generate_series(1,100000); INSERT 0 100000 -- and then checkpoint digoal=# checkpoint; CHECKPOINT -- we can see checkpoint flush the normal table's dirty page to disk digoal=# select * from pg_stat_file(pg_relation_filepath('u')), pg_relation_filepath('u'); size | access | modification | change | creation | isdir | pg_relation_filepath ---------+------------------------+------------------------+------------------------+----------+-------+---------------------- 7249920 | 2013-12-23 17:36:54+08 | 2013-12-23 17:37:29+08 | 2013-12-23 17:37:29+08 | | f | base/16399/122891 (1 row) -- or use this method , change the table to logged table after insert data digoal=# update pg_class set relpersistence ='u' where relname='u'; UPDATE 1 digoal=# insert into u select generate_series(1,100000); INSERT 0 100000 digoal=# update pg_class set relpersistence ='p' where relname='u'; UPDATE 1 digoal=# checkpoint; CHECKPOINT digoal=# select * from pg_stat_file(pg_relation_filepath('u')), pg_relation_filepath('u'); size | access | modification | change | creation | isdir | pg_relation_filepath ----------+------------------------+------------------------+------------------------+----------+-------+---------------------- 10878976 | 2013-12-23 17:36:54+08 | 2013-12-23 17:40:16+08 | 2013-12-23 17:40:16+08 | | f | base/16399/122891 (1 row) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs