Re: WAL Rate Limiting - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WAL Rate Limiting
Date
Msg-id 27643.1389887577@sss.pgh.pa.us
Whole thread Raw
In response to Re: WAL Rate Limiting  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: WAL Rate Limiting  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> On 01/16/2014 05:39 PM, Andres Freund wrote:
>> Do you see a reasonable way to implement this generically for all
>> commands? I don't.

> In suitable safe places, check if you've written too much WAL, and sleep 
> if so. Call it CHECK_FOR_WAL_BUDGET(), along the lines of 
> CHECK_FOR_INTERRUPTS(), but called less frequently. Or maybe 
> vacuum_delay_point() is a better analogy. Hopefully you don't need to 
> sprinkle them in too many places to be useful.

We probably don't really need to implement it for "all" commands; I think
everyone can agree that, say, ALTER TABLE RENAME COLUMN isn't going to
emit enough WAL to really matter.  My point was that we should try to hit
everything that potentially *could* generate lots of WAL, rather than
arbitrarily deciding that some are utility commands and some are not.

For INSERT/UPDATE/DELETE, likely you could do this with a single 
CHECK_FOR_WAL_BUDGET() added at a strategic spot in nodeModifyTable.c.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: WAL Rate Limiting
Next
From: Stephen Frost
Date:
Subject: Re: Why conf.d should be default, and auto.conf and recovery.conf should be in it