From:
Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To:
Euler Taveira de Oliveira <euler(at)timbira(dot)com>
Cc:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:
Re: xlog location arithmetic
Date:
2012-02-10 08:32:46
Message-ID:
CAHGQGwFW3drMELnwytG5P1Vqk2HBcQbH4M1_jeHLN6L5E2GyNg@mail.gmail.com (view raw or flat )
Thread:
2011-12-06 04:19:49 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2011-12-06 10:14:02 from Magnus Hagander <magnus(at)hagander(dot)net>
2011-12-06 16:11:32 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-12-06 18:00:51 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2011-12-06 18:06:36 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-12-13 17:48:22 from Jim Nasby <jim(at)nasby(dot)net>
2011-12-13 20:37:10 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-12-20 10:27:41 from Magnus Hagander <magnus(at)hagander(dot)net>
2011-12-20 13:08:50 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2011-12-23 11:54:22 from Magnus Hagander <magnus(at)hagander(dot)net>
2011-12-23 15:05:54 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-23 15:13:41 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-12-23 15:18:21 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-23 15:32:29 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-12-23 15:59:35 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2011-12-23 16:15:07 from Robert Haas <robertmhaas(at)gmail(dot)com>
2011-12-23 15:13:42 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2012-01-21 16:13:41 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2012-01-26 09:19:28 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-02-07 17:29:16 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2012-02-08 12:35:15 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-02-09 22:00:30 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2012-02-10 08:32:46 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-02-25 12:23:25 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-02-25 23:53:19 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2012-02-28 06:21:12 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-03-04 11:26:56 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-03-04 11:26:36 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-03-09 12:11:13 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-03-09 14:37:35 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 14:44:08 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-09 15:00:55 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 14:55:09 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 15:31:26 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-09 15:37:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 17:13:26 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-03-09 19:23:28 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-03-09 19:26:44 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 19:34:04 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-09 19:39:26 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-09 20:04:23 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 20:12:20 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-13 00:47:24 from Bruce Momjian <bruce(at)momjian(dot)us>
2012-03-13 02:51:50 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-03-13 03:03:42 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-13 03:36:45 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-03-09 19:37:43 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2012-03-09 17:14:00 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-03-09 17:18:24 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-03-09 17:38:28 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-03-09 18:23:38 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-03-13 02:34:10 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-04-13 20:30:16 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-04-14 11:25:42 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-04-14 12:08:12 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-17 14:46:07 from Peter Geoghegan <peter(at)2ndquadrant(dot)com>
2011-12-06 17:39:21 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2012-01-14 14:06:34 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2012-01-14 14:12:21 from Euler Taveira de Oliveira <euler(at)timbira(dot)com>
2012-01-15 01:18:31 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-01-15 03:49:00 from Gurjeet Singh <singh(dot)gurjeet(at)gmail(dot)com>
2012-01-15 04:44:08 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-01-15 08:17:54 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-01-15 08:37:30 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-01-15 08:45:25 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-01-16 17:57:25 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-01-16 17:58:29 from Magnus Hagander <magnus(at)hagander(dot)net>
2012-01-16 20:48:41 from Josh Berkus <josh(at)agliodbs(dot)com>
2012-01-16 21:10:23 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-16 21:25:50 from Josh Berkus <josh(at)agliodbs(dot)com>
2012-01-16 21:37:59 from Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
2012-01-16 22:08:09 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-16 22:25:50 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-01-16 22:40:38 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-17 15:33:27 from Matteo Beccati <php(at)beccati(dot)com>
2012-01-17 16:50:41 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-17 17:10:11 from Matteo Beccati <php(at)beccati(dot)com>
2012-01-17 17:22:12 from Matteo Beccati <php(at)beccati(dot)com>
2012-01-17 16:50:20 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2012-01-17 17:24:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-01-17 20:17:05 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-18 01:23:13 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-18 02:46:36 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-22 18:53:39 from Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
2012-01-16 23:23:33 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2012-01-17 16:50:26 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-01-17 18:19:13 from Greg Smith <greg(at)2ndQuadrant(dot)com>
2012-01-19 17:59:35 from Alex Shulgin <ash(at)commandprompt(dot)com>
2012-01-22 18:54:30 from Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
2012-01-19 18:14:02 from Andrew Dunstan <andrew(at)dunslane(dot)net>
2012-01-19 18:41:54 from Alex Shulgin <ash(at)commandprompt(dot)com>
2012-01-19 19:04:07 from Alvaro Herrera <alvherre(at)commandprompt(dot)com>
2012-01-19 19:10:00 from Andrew Dunstan <andrew(at)dunslane(dot)net>
Lists:
pgsql-hackers
On Fri, Feb 10, 2012 at 7:00 AM, Euler Taveira de Oliveira
<euler(at)timbira(dot)com> wrote:
> On 08-02-2012 09:35, Fujii Masao wrote:
>
> Fujii, new patch attached. Thanks for your tests.
Thanks for the new patch!
>> But another problem happened. When I changed pg_proc.h so that the unused
>> OID was assigned to pg_xlog_location_diff(), and executed the above again,
>> I encountered the segmentation fault:
>>
> I reproduced the problems in my old 32-bit laptop. I fixed it casting to
> int64. I also updated the duplicated OID.
Yep, in the updated patch, I could confirm that the function works fine without
any error in my machine. The patch looks fine to me except the following minor
comments:
In the document, it's better to explain clearly that the function subtracts the
second argument from the first.
- These functions cannot be executed during recovery.
+ These functions cannot be executed during recovery (except
+ <function>pg_xlog_location_diff</function>).
+ <function>pg_xlog_location_diff</> calculates the difference in bytes
+ between two transaction log locations. It can be used with
+ <structname>pg_stat_replication</structname> or some functions shown in
+ <xref linkend="functions-admin-backup-table"> to get the replication lag.
Very minor comment: you should use spaces rather than a tab to indent each line.
>> Why OID needs to be reassigned?
>>
> There isn't a compelling reason. It is just a way to say: "hey, it is another
> function with the same old name".
>
> I'll not attach another version for pg_size_pretty because it is a matter of
> updating a duplicated OID.
Okay, I reviewed the previous patch again. That looks fine to me.
Regards,
--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center
In response to
Responses
pgsql-hackers by date
Next :From: Shigeru HanadaDate: 2012-02-10 11:39:55
Subject : Re: pgsql_fdw, FDW for PostgreSQL server
Previous :From : Tom LaneDate : 2012-02-10 06:24:29
Subject : Re: psql tab completion for SELECT