Re: fast promotion and log_checkpoints

Lists: pgsql-hackers
From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: fast promotion and log_checkpoints
Date: 2013-05-01 09:05:44
Message-ID: CAHGQGwHs3r2k-N7C=vWEk5e-fE7sTGWgZjbkD6X2_s0h+zqoVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

In HEAD, when the standby is promoted, recovery requests the checkpoint
but doesn't wait for its completion. I found the checkpoint starting log message
of this checkpoint looks odd as follows:

LOG: checkpoint starting:

I think something like the following is better.

LOG: checkpoint starting: end-of-recovery

In 9.2 or before, "end-of-recovery" part is logged. Even if we changed the
behavior of end-of-recovery checkpoint, I think that it's more intuitive to
label it as "end-of-recovery". Thought?

Regards,

--
Fujii Masao


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fast promotion and log_checkpoints
Date: 2013-05-19 14:22:49
Message-ID: CA+U5nM+Gcb=k-6B17oN_EQzGcGkSVr+yUjYNXh6RMJ-dP=CS_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 1 May 2013 10:05, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> In HEAD, when the standby is promoted, recovery requests the checkpoint
> but doesn't wait for its completion. I found the checkpoint starting log message
> of this checkpoint looks odd as follows:
>
> LOG: checkpoint starting:
>
> I think something like the following is better.
>
> LOG: checkpoint starting: end-of-recovery
>
> In 9.2 or before, "end-of-recovery" part is logged. Even if we changed the
> behavior of end-of-recovery checkpoint, I think that it's more intuitive to
> label it as "end-of-recovery". Thought?

The checkpoint isn't an "end-of-recovery" checkpoint, its just the
first checkpoint after the end of recovery. I don't think it should
say "end-of-recovery".

The problem is that we've now changed the code to trigger a checkpoint
in a place that wasn't part of the original design, so the checkpoint
called at that point isn't supplied with a reason and so has nothing
to print.

It would be possible to redesign this with a special new reason, or we
could just use "time" as the reason, or we could just leave it.

Do nothing is easy, though so are the others, so we can choose
anything we want. What do we want it to say?

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fast promotion and log_checkpoints
Date: 2013-05-20 19:06:20
Message-ID: 519A742C.7000606@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 19.05.2013 17:22, Simon Riggs wrote:
> On 1 May 2013 10:05, Fujii Masao<masao(dot)fujii(at)gmail(dot)com> wrote:
>
>> In HEAD, when the standby is promoted, recovery requests the checkpoint
>> but doesn't wait for its completion. I found the checkpoint starting log message
>> of this checkpoint looks odd as follows:
>>
>> LOG: checkpoint starting:
>>
>> I think something like the following is better.
>>
>> LOG: checkpoint starting: end-of-recovery
>>
>> In 9.2 or before, "end-of-recovery" part is logged. Even if we changed the
>> behavior of end-of-recovery checkpoint, I think that it's more intuitive to
>> label it as "end-of-recovery". Thought?
>
> The checkpoint isn't an "end-of-recovery" checkpoint, its just the
> first checkpoint after the end of recovery. I don't think it should
> say "end-of-recovery".

Agreed.

> The problem is that we've now changed the code to trigger a checkpoint
> in a place that wasn't part of the original design, so the checkpoint
> called at that point isn't supplied with a reason and so has nothing
> to print.
>
> It would be possible to redesign this with a special new reason, or we
> could just use "time" as the reason, or we could just leave it.
>
> Do nothing is easy, though so are the others, so we can choose
> anything we want. What do we want it to say?

I'm not sure. Perhaps we should print "(no flags)", so that it wouldn't
look like there's something missing in the log message.

- Heikk


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fast promotion and log_checkpoints
Date: 2013-05-20 19:44:20
Message-ID: CA+U5nMJ9hiqARzG0QF2E9HdM0pdQWoR4-rph5W02Fc0THMBkZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 20 May 2013 20:06, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> wrote:

>> It would be possible to redesign this with a special new reason, or we
>> could just use "time" as the reason, or we could just leave it.
>>
>> Do nothing is easy, though so are the others, so we can choose
>> anything we want. What do we want it to say?
>
>
> I'm not sure. Perhaps we should print "(no flags)", so that it wouldn't look
> like there's something missing in the log message.

The reason text would still be absent, so it wouldn't really help the
user interpret the log message correctly.

I suggest we use RequestCheckpoint(CHECKPOINT_CAUSE_TIME) instead,
since it is literally time for a checkpoint.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fast promotion and log_checkpoints
Date: 2013-05-21 14:29:15
Message-ID: CAHGQGwEyuTMskkJkFXNy2b9f8xdS0k7Pvt84P6vLodBkTgV6Hw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, May 21, 2013 at 4:44 AM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> On 20 May 2013 20:06, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> wrote:
>
>>> It would be possible to redesign this with a special new reason, or we
>>> could just use "time" as the reason, or we could just leave it.
>>>
>>> Do nothing is easy, though so are the others, so we can choose
>>> anything we want. What do we want it to say?
>>
>>
>> I'm not sure. Perhaps we should print "(no flags)", so that it wouldn't look
>> like there's something missing in the log message.
>
> The reason text would still be absent, so it wouldn't really help the
> user interpret the log message correctly.
>
> I suggest we use RequestCheckpoint(CHECKPOINT_CAUSE_TIME) instead,
> since it is literally time for a checkpoint.

Or, what about using CHECKPOINT_FORCE and just printing "force"?
Currently that checkpoint always starts because of existence of the
end-of-recovery record, but I think we should ensure that the checkpoint
always starts by using that flag.

Regards,

--
Fujii Masao


From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: fast promotion and log_checkpoints
Date: 2013-05-21 15:02:51
Message-ID: CA+U5nMKm6-9Tvy9zw9pJ9R4uXwAaF-SqNt5Xbq1Y=vA970nn+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 21 May 2013 15:29, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:

> Or, what about using CHECKPOINT_FORCE and just printing "force"?
> Currently that checkpoint always starts because of existence of the
> end-of-recovery record, but I think we should ensure that the checkpoint
> always starts by using that flag.

This would mean we can't use the secondary checkpoint record, but we
already gave that up so should be OK.

Three people, three suggestions; so I will agree to this suggestion so
we can get on with it.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services