Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-18 Thread Robert Haas
On Fri, Dec 14, 2012 at 7:19 PM, Andres Freund and...@2ndquadrant.com wrote: On 2012-12-14 14:01:30 -0500, Robert Haas wrote: On Fri, Dec 14, 2012 at 6:46 AM, Andres Freund and...@2ndquadrant.com wrote: Just moving that tidbit inside the lock seems to be the pragmatic choice. GetOldestXmin

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-18 Thread anara...@anarazel.de
Hi, Robert Haas robertmh...@gmail.com schrieb: On Fri, Dec 14, 2012 at 7:19 PM, Andres Freund and...@2ndquadrant.com wrote: On 2012-12-14 14:01:30 -0500, Robert Haas wrote: On Fri, Dec 14, 2012 at 6:46 AM, Andres Freund and...@2ndquadrant.com wrote: Just moving that tidbit inside the lock

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-18 Thread Robert Haas
On Tue, Dec 18, 2012 at 5:25 PM, anara...@anarazel.de and...@anarazel.de wrote: The problem is that at the time GetSnapshotData returns the xmin horizon might have gone upwards and tuples required for decoding might get removed by other backends. That needs to be prevented while holding the

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-18 Thread Andres Freund
On 2012-12-18 19:56:18 -0500, Robert Haas wrote: On Tue, Dec 18, 2012 at 5:25 PM, anara...@anarazel.de and...@anarazel.de wrote: The problem is that at the time GetSnapshotData returns the xmin horizon might have gone upwards and tuples required for decoding might get removed by other

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-18 Thread Robert Haas
On Tue, Dec 18, 2012 at 7:59 PM, Andres Freund and...@2ndquadrant.com wrote: On 2012-12-18 19:56:18 -0500, Robert Haas wrote: On Tue, Dec 18, 2012 at 5:25 PM, anara...@anarazel.de and...@anarazel.de wrote: The problem is that at the time GetSnapshotData returns the xmin horizon might have

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-16 Thread Andres Freund
On 2012-12-15 01:19:26 +0100, Andres Freund wrote: On 2012-12-14 14:01:30 -0500, Robert Haas wrote: On Fri, Dec 14, 2012 at 6:46 AM, Andres Freund and...@2ndquadrant.com wrote: Just moving that tidbit inside the lock seems to be the pragmatic choice. GetOldestXmin is called *

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-16 Thread Simon Riggs
On 13 December 2012 20:03, Andres Freund and...@2ndquadrant.com wrote: Does anybody have an opinion on the attached patches? Especially 0001, which contains the procarray changes? It moves a computation of the sort of: result -= vacuum_defer_cleanup_age; if (!TransactionIdIsNormal(result))

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-16 Thread Andres Freund
On 2012-12-16 16:44:04 +, Simon Riggs wrote: On 13 December 2012 20:03, Andres Freund and...@2ndquadrant.com wrote: Does anybody have an opinion on the attached patches? Especially 0001, which contains the procarray changes? It moves a computation of the sort of: result -=

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-14 Thread Andres Freund
On 2012-12-13 23:35:00 +, Simon Riggs wrote: On 13 December 2012 22:37, Andres Freund and...@2ndquadrant.com wrote: On 2012-12-13 17:29:06 -0500, Robert Haas wrote: On Thu, Dec 13, 2012 at 3:03 PM, Andres Freund and...@2ndquadrant.com wrote: It moves a computation of the sort of:

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-14 Thread Robert Haas
On Fri, Dec 14, 2012 at 6:46 AM, Andres Freund and...@2ndquadrant.com wrote: Just moving that tidbit inside the lock seems to be the pragmatic choice. GetOldestXmin is called * once per checkpoint * one per index build * once in analyze * twice per vacuum * once for HS feedback messages

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-14 Thread Andres Freund
On 2012-12-14 14:01:30 -0500, Robert Haas wrote: On Fri, Dec 14, 2012 at 6:46 AM, Andres Freund and...@2ndquadrant.com wrote: Just moving that tidbit inside the lock seems to be the pragmatic choice. GetOldestXmin is called * once per checkpoint * one per index build * once in analyze

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-13 Thread Andres Freund
On 2012-12-13 18:29:00 +0100, Andres Freund wrote: On 2012-12-13 00:05:41 +, Peter Geoghegan wrote: Initialisation means finding a free “logical slot” from shared memory, then looping until the new magic xmin horizon for logical walsenders (stored in their “slot”) is that of the weakest

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-13 Thread Robert Haas
On Thu, Dec 13, 2012 at 3:03 PM, Andres Freund and...@2ndquadrant.com wrote: It moves a computation of the sort of: result -= vacuum_defer_cleanup_age; if (!TransactionIdIsNormal(result)) result = FirstNormalTransactionId; inside ProcArrayLock. But I can't really imagine that to be

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-13 Thread Andres Freund
On 2012-12-13 17:29:06 -0500, Robert Haas wrote: On Thu, Dec 13, 2012 at 3:03 PM, Andres Freund and...@2ndquadrant.com wrote: It moves a computation of the sort of: result -= vacuum_defer_cleanup_age; if (!TransactionIdIsNormal(result)) result = FirstNormalTransactionId; inside

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-13 Thread Simon Riggs
On 13 December 2012 22:37, Andres Freund and...@2ndquadrant.com wrote: On 2012-12-13 17:29:06 -0500, Robert Haas wrote: On Thu, Dec 13, 2012 at 3:03 PM, Andres Freund and...@2ndquadrant.com wrote: It moves a computation of the sort of: result -= vacuum_defer_cleanup_age; if

Re: [HACKERS] logical decoding - GetOldestXmin

2012-12-13 Thread Michael Paquier
On Fri, Dec 14, 2012 at 2:29 AM, Robert Haas robertmh...@gmail.com wrote: On Thu, Dec 13, 2012 at 3:03 PM, Andres Freund and...@2ndquadrant.com wrote: It moves a computation of the sort of: result -= vacuum_defer_cleanup_age; if (!TransactionIdIsNormal(result)) result =