Re: PATCH: add pg_current_xlog_flush_location function

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: add pg_current_xlog_flush_location function
Date: 2016-01-12 07:59:20
Message-ID: CANP8+jLGh3yxM52UhhbYSvitCdu=bboY=YSLvLp3LPO9DsTqcA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 12 January 2016 at 05:58, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
wrote:

> On Tue, Jan 12, 2016 at 6:35 AM, Simon Riggs wrote:
> > Comments in xlog.c say
> >
> > "In addition to the shared variable, each backend has a private copy of
> > LogwrtResult, which is updated when convenient."
> > It is therefore valid to update the value of both Write and Flush
> positions
> > at the same time, any time either is required.
>
> Yes I saw this one yesterday when looking at this code. My comment
> regarded the potential interactions between this field with XLogFlush,
> but now I see that my concerns are not valid, updating more frequently
> LogwrtResult may save some cycles though.
>
> > My suggested commit pattern for this is...
> > 1. Update existing function to maintain LogwrtResult more eagerly
> (separate
> > patch)
>
> The only place I see now that would benefit a bit from that is
> UpdateMinRecoveryPoint when info_lck is taken, which can be called by
> XLogFlush. Though I would expect this to have minimal impact.
>
> > 2. Have the patch use the existing function name (main patch)
>
> Yeah, we had better just use GetFlushRecPtr and be done with it. It
> seems that there is little point to add a new function, and it is not
> going to be called that much so its effects in updating LogwrtResult
> would be minimized for a single backend.
>

Patch committed, thanks for patch and review.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2016-01-12 08:20:05 Re: Patch: fix lock contention for HASHHDR.mutex
Previous Message Michael Paquier 2016-01-12 07:51:11 Re: extend pgbench expressions with functions