PGPROCs of autovac workers (was Re: [PATCHES] autovacuum multiworkers, patch 5)

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: PGPROCs of autovac workers (was Re: [PATCHES] autovacuum multiworkers, patch 5)
Date: 2007-04-09 16:58:12
Message-ID: 20070409165812.GD10785@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Alvaro Herrera wrote:

> Thanks! I had already incorporated the foreach_worker changes into my
> code, and later realized that there's an important bug regarding the
> PGPROC of the workers, so I've reworked the patch, which meant that the
> foreach_worker() macro went away completely.

FWIW, the problem was that it is difficult to keep the "max_connections"
control and still allow extra connections for autovacuum so that it
doesn't hinder regular operation. The first thing I tried was enlarging
the PGPROC array, but the problem with that is that the max_connection
tests get unwieldy (it would have to cycle through all used PGPROCs and
count the autovacuum ones).

So I'm now leaning towards having autovacuum keep their PGPROCs
separately, similarly to what the 2-phase code does, the main difference
being that 2PC doesn't have semaphores, while these ones will because
they need to acquire locks.

This needs a bit of rejigger in InitProcess() so that it acquires a
PGPROC from ProcGlobal if a regular backend, or from autovac's array
otherwise. This has not been very invasive.

If there's an objection to this, and/or better ideas, please speak
quickly!

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-04-09 17:17:11 Re: What X86/X64 OS's do we need coverage for?
Previous Message Andrew Dunstan 2007-04-09 16:45:45 Re: What X86/X64 OS's do we need coverage for?

Browse pgsql-patches by date

  From Date Subject
Next Message Martijn van Oosterhout 2007-04-09 19:57:34 Re: [HACKERS] Arrays of Complex Types
Previous Message David Fetter 2007-04-09 16:39:36 Re: [HACKERS] Arrays of Complex Types