Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-12 Thread Simon Riggs
On 12 January 2016 at 05:58, Michael Paquier 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." > >

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-11 Thread Michael Paquier
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

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-11 Thread Simon Riggs
On 11 January 2016 at 12:01, Tomas Vondra wrote: > > On 01/11/2016 06:30 AM, Michael Paquier wrote: > >> >> Updating LogwrtResult directly when calling your new function >> GetXLogFlushRecPtr() does not strike me as a particularly good idea >> per this portion in

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-11 Thread Tomas Vondra
On 01/11/2016 06:30 AM, Michael Paquier wrote: Updating LogwrtResult directly when calling your new function GetXLogFlushRecPtr() does not strike me as a particularly good idea per this portion in XLogFlush(): > /* Quick exit if already known flushed */ if (record <=

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-10 Thread Michael Paquier
On Mon, Jan 11, 2016 at 1:15 PM, Amit Kapila wrote: > On Mon, Jan 11, 2016 at 3:29 AM, Tomas Vondra > wrote: >> >> Hi, >> >> On 12/13/2015 08:38 PM, Tomas Vondra wrote: >>> >>> Hi, >>> >>> On 12/13/2015 06:13 AM, Amit Kapila wrote: >>> >

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-10 Thread Amit Kapila
On Mon, Jan 11, 2016 at 3:29 AM, Tomas Vondra wrote: > Hi, > > On 12/13/2015 08:38 PM, Tomas Vondra wrote: > >> Hi, >> >> On 12/13/2015 06:13 AM, Amit Kapila wrote: >> > >> >>> ... >>> >> > >> >>> Is there a reason why you can't use existing function >>>

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2016-01-10 Thread Tomas Vondra
Hi, On 12/13/2015 08:38 PM, Tomas Vondra wrote: Hi, On 12/13/2015 06:13 AM, Amit Kapila wrote: > ... > Is there a reason why you can't use existing function GetFlushRecPtr() in xlog.c? No, not really. I think I somehow missed that function when writing the initial version of the patch.

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2015-12-13 Thread Tomas Vondra
Hi, On 12/13/2015 06:13 AM, Amit Kapila wrote: > ... > Is there a reason why you can't use existing function GetFlushRecPtr() in xlog.c? No, not really. I think I somehow missed that function when writing the initial version of the patch. Will fix in v2 of the patch. thanks -- Tomas

Re: [HACKERS] PATCH: add pg_current_xlog_flush_location function

2015-12-12 Thread Amit Kapila
On Sun, Dec 13, 2015 at 12:07 AM, Tomas Vondra wrote: > Hi, > > attached is a patch adding a function pg_current_xlog_flush_location(), > which proved quite useful when investigating the ext4 data loss bug. It's > mostly what was already sent to that thread, except

[HACKERS] PATCH: add pg_current_xlog_flush_location function

2015-12-12 Thread Tomas Vondra
Hi, attached is a patch adding a function pg_current_xlog_flush_location(), which proved quite useful when investigating the ext4 data loss bug. It's mostly what was already sent to that thread, except for docs that were missing in the initial version. I'll put this into 2016-01 CF.