Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] autovacuum does not start in HEAD

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-patches(at)postgresql(dot)org, alvherre(at)commandprompt(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] autovacuum does not start in HEAD
Date: 2007-04-26 01:26:38
Message-ID: 20070426102316.654D.ITAGAKI.TAKAHIRO@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
I wrote:
> I found that autovacuum launcher does not launch any workers in HEAD.

The attached autovacuum-fix.patch could fix the problem. I changed
to use 'greater or equal' instead of 'greater' at the decision of
next autovacuum target.

The point was in the resolution of timer; There is a platform that timer
has only a resolution of milliseconds. We initialize adl_next_worker with
current_time in rebuild_database_list(), but we could use again the same
value in do_start_worker(), because there is no measurable difference
in those low-resolution-platforms.


Another attached patch, autovacuum-debug.patch, is just for printf-debug.
I got the following logs without fix -- autovacuum never works.

# SELECT oid, datname FROM pg_database ORDER BY oid;
  oid  |  datname  
-------+-----------
     1 | template1
 11494 | template0
 11495 | postgres
 16384 | bench
(4 rows)

# pgbench bench -s1 -c1 -t100000
[with configurations of autovacuum_naptime = 10s and log_min_messages = debug1]

LOG:  do_start_worker skip : 230863399.250000, 230863399.250000, 230863409.250000
LOG:  rebuild_database_list: db=11495, time=230863404.250000
LOG:  rebuild_database_list: db=16384, time=230863409.250000
DEBUG:  autovacuum: processing database "bench"
LOG:  do_start_worker skip : 230863404.250000, 230863404.250000, 230863414.250000
LOG:  do_start_worker skip : 230863404.250000, 230863409.250000, 230863414.250000
LOG:  rebuild_database_list: db=11495, time=230863409.250000
LOG:  rebuild_database_list: db=16384, time=230863414.250000
LOG:  do_start_worker skip : 230863409.250000, 230863409.250000, 230863419.250000
LOG:  do_start_worker skip : 230863409.250000, 230863414.250000, 230863419.250000
LOG:  rebuild_database_list: db=11495, time=230863414.250000
LOG:  rebuild_database_list: db=16384, time=230863419.250000
...
(no autovacuum activities forever)

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment: autovacuum-fix.patch
Description: application/octet-stream (685 bytes)
Attachment: autovacuum-debug.patch
Description: application/octet-stream (1.4 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Alvaro HerreraDate: 2007-04-26 03:04:45
Subject: Re: strange buildfarm failures
Previous:From: Koichi SuzukiDate: 2007-04-26 01:19:45
Subject: Re: [HACKERS] Full page writes improvement, code update

pgsql-patches by date

Next:From: Gregory StarkDate: 2007-04-26 02:21:06
Subject: Re: LIMIT/SORT optimization
Previous:From: Koichi SuzukiDate: 2007-04-26 01:19:45
Subject: Re: [HACKERS] Full page writes improvement, code update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group