Re: [HACKERS] Checkpoint throttling issues

2015-10-22 Thread Robert Haas
On Mon, Oct 19, 2015 at 6:10 AM, Andres Freund wrote: > 1) The progress passed to CheckpointWriteDelay() will often be wrong - >it's calculated as num_written / num_to_write, but num_written is only >incremented if the buffer hasn't since independently been written >

Re: [HACKERS] Checkpoint throttling issues

2015-10-22 Thread Andres Freund
On 2015-10-22 09:52:25 -0400, Robert Haas wrote: > On Mon, Oct 19, 2015 at 6:10 AM, Andres Freund wrote: > > 1) The progress passed to CheckpointWriteDelay() will often be wrong - > >it's calculated as num_written / num_to_write, but num_written is only > >incremented

Re: [HACKERS] Checkpoint throttling issues

2015-10-20 Thread Amit Kapila
On Tue, Oct 20, 2015 at 1:05 AM, Alvaro Herrera wrote: > > Fabien COELHO wrote: > > > >4) It's a bit dubious to only pgstat_send_bgwriter() when on schedule. > > > > No opinion! > > My guess here, without looking, is that this was based on the idea of > "oops, we're late

[HACKERS] Checkpoint throttling issues

2015-10-19 Thread Andres Freund
Hi, working on the checkpoint sorting/flushing patch I noticed a number of preexisting issues: 1) The progress passed to CheckpointWriteDelay() will often be wrong - it's calculated as num_written / num_to_write, but num_written is only incremented if the buffer hasn't since independently

Re: [HACKERS] Checkpoint throttling issues

2015-10-19 Thread Fabien COELHO
preexisting issues: 1) The progress passed to CheckpointWriteDelay() will often be wrong - it's calculated as num_written / num_to_write, but num_written is only incremented if the buffer hasn't since independently been written out. That's bad because it mean's we'll think we're further

Re: [HACKERS] Checkpoint throttling issues

2015-10-19 Thread Alvaro Herrera
Fabien COELHO wrote: > >4) It's a bit dubious to only pgstat_send_bgwriter() when on schedule. > > No opinion! My guess here, without looking, is that this was based on the idea of "oops, we're late here for the checkpoint, let's do as less work as possible to avoid getting even later", and