Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-10-18 Thread Robert Haas
On Wed, Oct 9, 2013 at 2:28 PM, Robert Haas robertmh...@gmail.com wrote: On Sat, Sep 14, 2013 at 3:03 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-10-18 Thread Alvaro Herrera
Robert Haas escribió: A broader complaint I have with this patch is that it almost but not-quite solves a problem I've had a few times in the past: namely, searching through the data directory for data blocks which have LSNs in the future. This has come up a few times for me, and this tool

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-10-18 Thread Amit Kapila
On Fri, Oct 18, 2013 at 9:01 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Oct 9, 2013 at 2:28 PM, Robert Haas robertmh...@gmail.com wrote: On Sat, Sep 14, 2013 at 3:03 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-10-18 Thread Amit Kapila
On Fri, Oct 18, 2013 at 9:24 PM, Alvaro Herrera alvhe...@2ndquadrant.com wrote: Robert Haas escribió: A broader complaint I have with this patch is that it almost but not-quite solves a problem I've had a few times in the past: namely, searching through the data directory for data blocks

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-10-09 Thread Robert Haas
On Sat, Sep 14, 2013 at 3:03 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres Freund wrote: On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-10-09 Thread Amit Kapila
On Wed, Oct 9, 2013 at 11:58 PM, Robert Haas robertmh...@gmail.com wrote: On Sat, Sep 14, 2013 at 3:03 AM, Amit Kapila amit.kapil...@gmail.com wrote: On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-09-14 Thread Amit Kapila
On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres Freund wrote: On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This utility can also be used to decide whether backup is required or not when

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-08 Thread Hari Babu
On Friday, July 05, 2013 6:48 PM Hari Babu wrote: On Thursday, July 04, 2013 11:19 PM Robert Haas wrote: The patch is updated with the following changes. 1.If the input data is data directory, all the errors occurred are displayed at once instead of one error at a time. 2.Fixed the problem of

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-08 Thread 'Andres Freund'
On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This utility can also be used to decide whether backup is required or not when the data page +in old-master precedes the last applied LSN in old-standby (i.e., new-master) at the +moment of the failover. + /para + /refsect1 I

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-08 Thread Amit Kapila
On Monday, July 08, 2013 4:26 PM Andres Freund wrote: On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This utility can also be used to decide whether backup is required or not when the data page +in old-master precedes the last applied LSN in old-standby (i.e., new-master) at the

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-08 Thread 'Andres Freund'
On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres Freund wrote: On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This utility can also be used to decide whether backup is required or not when the data page +in old-master precedes the last

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-08 Thread Hari Babu
On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres Freund wrote: On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This utility can also be used to decide whether backup is required or not when

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-08 Thread Amit Kapila
On Monday, July 08, 2013 5:16 PM Andres Freund wrote: On 2013-07-08 17:10:43 +0530, Amit Kapila wrote: On Monday, July 08, 2013 4:26 PM Andres Freund wrote: On 2013-07-08 16:17:54 +0530, Hari Babu wrote: +This utility can also be used to decide whether backup is required or not

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-05 Thread Hari Babu
On Thursday, July 04, 2013 11:19 PM Robert Haas wrote: + fprintf(stderr, _(%s: .. file \%s\ for seeking: %s\n), + progname, filename, strerror(errno)); Weird error message style - what's with the ..? + fprintf(stderr, _(%s: .. file \%s\

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-04 Thread Amit Kapila
On Wednesday, July 03, 2013 7:41 PM Robert Haas wrote: On Wed, Jul 3, 2013 at 9:51 AM, Amit Kapila amit.kap...@huawei.com wrote: amit@linux:~ md test amit@linux:~ cd test amit@linux:~/test ln -s ~/test link_test amit@linux:~/test ls link_test amit@linux:~/test cd link_test

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-04 Thread Hari Babu
On Wednesday, July 03, 2013 1:26 AM Robert Haas Wrote: On Tue, Jun 25, 2013 at 1:42 PM, Andres Freund and...@2ndquadrant.com wrote: I think the usecase for this utility isn't big enough to be included in postgres since it really can only help in a very limited circumstances. And I think it's

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-04 Thread Robert Haas
On Thu, Jul 4, 2013 at 2:14 AM, Amit Kapila amit.kap...@huawei.com wrote: It can cause error too many levels of symbolic links Sure, so you report the error and exit. No problem. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-04 Thread Robert Haas
This looks better. + fprintf(stderr, _(%s: .. file \%s\ for seeking: %s\n), + progname, filename, strerror(errno)); Weird error message style - what's with the ..? + fprintf(stderr, _(%s: .. file \%s\ length is more than segment size:

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-03 Thread Amit Kapila
On Wednesday, July 03, 2013 1:26 AM Robert Haas wrote: On Tue, Jun 25, 2013 at 1:42 PM, Andres Freund and...@2ndquadrant.com wrote: I think the usecase for this utility isn't big enough to be included in postgres since it really can only help in a very limited circumstances. And I think

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-03 Thread Robert Haas
On Wed, Jul 3, 2013 at 8:44 AM, Amit Kapila amit.kap...@huawei.com wrote: Why does this patch need all of this fancy path-handling logic - specifically, remove_parent_refernces() and make_absolute_path()? Surely its needs are not that different from pg_ctl or pg_resetxlog or pg_controldata.

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-03 Thread Amit Kapila
-Original Message- From: Robert Haas [mailto:robertmh...@gmail.com] Sent: Wednesday, July 03, 2013 6:40 PM To: Amit Kapila Cc: Andres Freund; Josh Berkus; pgsql-hackers@postgresql.org Subject: Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages On Wed, Jul 3, 2013 at 8

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-03 Thread Robert Haas
On Wed, Jul 3, 2013 at 9:51 AM, Amit Kapila amit.kap...@huawei.com wrote: amit@linux:~ md test amit@linux:~ cd test amit@linux:~/test ln -s ~/test link_test amit@linux:~/test ls link_test amit@linux:~/test cd link_test amit@linux:~/test/link_test ls link_test amit@linux:~/test/link_test

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-07-02 Thread Robert Haas
On Tue, Jun 25, 2013 at 1:42 PM, Andres Freund and...@2ndquadrant.com wrote: I think the usecase for this utility isn't big enough to be included in postgres since it really can only help in a very limited circumstances. And I think it's too likely to be misused for stuff it's not useable for

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-27 Thread Amit Kapila
On Thursday, June 27, 2013 11:26 AM Andres Freund wrote: On 2013-06-27 11:16:25 +0530, Amit Kapila wrote: On Wednesday, June 26, 2013 10:19 PM Fujii Masao wrote: On Wed, Jun 26, 2013 at 8:57 PM, Amit Kapila amit.kap...@huawei.com One more use case for which this utility was done is

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread Andres Freund
On 2013-06-26 08:50:27 +0530, Amit Kapila wrote: On Tuesday, June 25, 2013 11:12 PM Andres Freund wrote: On 2013-06-16 17:19:49 -0700, Josh Berkus wrote: Amit posted a new version of this patch on January 23rd. But last comment on it by Tom is not sure everyone wants this.

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread Amit Kapila
On Wednesday, June 26, 2013 1:20 PM Andres Freund wrote: On 2013-06-26 08:50:27 +0530, Amit Kapila wrote: On Tuesday, June 25, 2013 11:12 PM Andres Freund wrote: On 2013-06-16 17:19:49 -0700, Josh Berkus wrote: Amit posted a new version of this patch on January 23rd. But last

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread Andres Freund
Hi Amit, On 2013-06-26 16:22:28 +0530, Amit Kapila wrote: On Wednesday, June 26, 2013 1:20 PM Andres Freund wrote: On 2013-06-26 08:50:27 +0530, Amit Kapila wrote: On Tuesday, June 25, 2013 11:12 PM Andres Freund wrote: On 2013-06-16 17:19:49 -0700, Josh Berkus wrote: Amit posted a

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread Amit Kapila
On Wednesday, June 26, 2013 4:40 PM Andres Freund wrote: Hi Amit, On 2013-06-26 16:22:28 +0530, Amit Kapila wrote: On Wednesday, June 26, 2013 1:20 PM Andres Freund wrote: On 2013-06-26 08:50:27 +0530, Amit Kapila wrote: On Tuesday, June 25, 2013 11:12 PM Andres Freund wrote: On

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread Fujii Masao
On Wed, Jun 26, 2013 at 8:57 PM, Amit Kapila amit.kap...@huawei.com wrote: On Wednesday, June 26, 2013 4:40 PM Andres Freund wrote: Hi Amit, On 2013-06-26 16:22:28 +0530, Amit Kapila wrote: On Wednesday, June 26, 2013 1:20 PM Andres Freund wrote: On 2013-06-26 08:50:27 +0530, Amit Kapila

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread Amit Kapila
On Wednesday, June 26, 2013 10:19 PM Fujii Masao wrote: On Wed, Jun 26, 2013 at 8:57 PM, Amit Kapila amit.kap...@huawei.com wrote: On Wednesday, June 26, 2013 4:40 PM Andres Freund wrote: Hi Amit, On 2013-06-26 16:22:28 +0530, Amit Kapila wrote: On Wednesday, June 26, 2013 1:20 PM

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-26 Thread 'Andres Freund'
On 2013-06-27 11:16:25 +0530, Amit Kapila wrote: On Wednesday, June 26, 2013 10:19 PM Fujii Masao wrote: On Wed, Jun 26, 2013 at 8:57 PM, Amit Kapila amit.kap...@huawei.com One more use case for which this utility was done is as below: It will be used to decide that on new-standby

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-25 Thread Andres Freund
Hi, On 2013-06-16 17:19:49 -0700, Josh Berkus wrote: Amit posted a new version of this patch on January 23rd. But last comment on it by Tom is not sure everyone wants this. https://commitfest.postgresql.org/action/patch_view?id=905 ... so, what's the status of this patch? That comment

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-25 Thread Amit Kapila
On Tuesday, June 25, 2013 11:12 PM Andres Freund wrote: Hi, On 2013-06-16 17:19:49 -0700, Josh Berkus wrote: Amit posted a new version of this patch on January 23rd. But last comment on it by Tom is not sure everyone wants this.

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-06-16 Thread Josh Berkus
Hackers, Amit posted a new version of this patch on January 23rd. But last comment on it by Tom is not sure everyone wants this. https://commitfest.postgresql.org/action/patch_view?id=905 ... so, what's the status of this patch? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-21 Thread Amit kapila
On Sunday, January 20, 2013 10:50 AM Amit kapila wrote: On Sunday, January 20, 2013 4:04 AM Dickson S. Guedes wrote: 2013/1/18 Amit kapila amit.kap...@huawei.com: Please find the rebased Patch for Compute MAX LSN. The function 'remove_parent_refernces' couldn't be called

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-20 Thread Dickson S. Guedes
2013/1/20 Amit kapila amit.kap...@huawei.com: On Sunday, January 20, 2013 4:04 AM Dickson S. Guedes wrote: 2013/1/18 Amit kapila amit.kap...@huawei.com: Please find the rebased Patch for Compute MAX LSN. The function 'remove_parent_refernces' couldn't be called 'remove_parent_references' ?

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-19 Thread Dickson S. Guedes
2013/1/18 Amit kapila amit.kap...@huawei.com: Please find the rebased Patch for Compute MAX LSN. The function 'remove_parent_refernces' couldn't be called 'remove_parent_references' ? Why not an extension in PGXN instead of a contrib? Regards, -- Dickson S. Guedes mail/xmpp:

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-19 Thread Amit kapila
On Sunday, January 20, 2013 4:04 AM Dickson S. Guedes wrote: 2013/1/18 Amit kapila amit.kap...@huawei.com: Please find the rebased Patch for Compute MAX LSN. The function 'remove_parent_refernces' couldn't be called 'remove_parent_references' ? Shall fix this. Why not an extension in PGXN

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2013-01-18 Thread Amit kapila
Please find the rebased Patch for Compute MAX LSN. There was one compilation error as undefined reference to XLByteLT as earlier XLogRecPtr was a structure as typedef struct XLogRecPtr { uint32

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-12-08 Thread Amit kapila
On Saturday, December 08, 2012 9:44 AM Tom Lane wrote: Amit kapila amit.kap...@huawei.com writes: On Friday, December 07, 2012 7:43 PM Muhammad Usama wrote: Although I am thinking why are you disallowing the absolute path of file. Any particular reason? The reason to disallow absolute path

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-12-07 Thread Muhammad Usama
Hi Amit On Mon, Dec 3, 2012 at 6:56 PM, Amit kapila amit.kap...@huawei.com wrote: I think we should expect provided path to be relative to current directory or may consider it to be relative to either one of Data or CWD. Because normally we expect path to be relative to CWD if some program

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-12-07 Thread Amit kapila
Hi Muhammad, On Friday, December 07, 2012 7:43 PM Muhammad Usama wrote: Hi Amit On Mon, Dec 3, 2012 at 6:56 PM, Amit kapila amit.kap...@huawei.commailto:amit.kap...@huawei.com wrote: I think we should expect provided path to be relative to current directory or may consider it to be relative to

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-12-07 Thread Tom Lane
Amit kapila amit.kap...@huawei.com writes: On Friday, December 07, 2012 7:43 PM Muhammad Usama wrote: Although I am thinking why are you disallowing the absolute path of file. Any particular reason? The reason to disallow absolute path is that, we need to test on multiple platforms and to

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-12-03 Thread Amit kapila
I think we should expect provided path to be relative to current directory or may consider it to be relative to either one of Data or CWD. Because normally we expect path to be relative to CWD if some program is asking for path in command line. Please find the attached patch to make the path

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-28 Thread Amit Kapila
On Wednesday, November 28, 2012 11:49 AM Muhammad Usama wrote: On Tue, Nov 27, 2012 at 5:52 PM, Amit kapila amit.kap...@huawei.com wrote: Friday, November 23, 2012 5:38 AM Muhammad Usama wrote:   - For -p {file | dir}  option the utility expects the file path relative to the specified data

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-27 Thread Amit kapila
Friday, November 23, 2012 5:38 AM Muhammad Usama wrote: Observations and Comments --- - If no option is given to pg_computemaxlsn utility then we get a wrong error message ./pg_computemaxlsn ../data pg_computemaxlsn: file or directory (null) exists

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-27 Thread Alvaro Herrera
Amit Kapila escribió: Friday, November 23, 2012 5:38 AM Muhammad Usama wrote: - I think when finding the max LSN of single file the utility should consider all relation segments. Would you like to find for all relation related segments: Like 12345, 12345.1 ... 12345.nOr 12345,

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-27 Thread Amit Kapila
On Wednesday, November 28, 2012 3:36 AM Alvaro Herrera wrote: Amit Kapila escribió: Friday, November 23, 2012 5:38 AM Muhammad Usama wrote: - I think when finding the max LSN of single file the utility should consider all relation segments. Would you like to find for all relation

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-27 Thread Muhammad Usama
On Tue, Nov 27, 2012 at 5:52 PM, Amit kapila amit.kap...@huawei.com wrote: Friday, November 23, 2012 5:38 AM Muhammad Usama wrote: Observations and Comments --- - If no option is given to pg_computemaxlsn utility then we get a wrong error

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-27 Thread Muhammad Usama
On Wed, Nov 28, 2012 at 3:06 AM, Alvaro Herrera alvhe...@2ndquadrant.comwrote: Amit Kapila escribió: Friday, November 23, 2012 5:38 AM Muhammad Usama wrote: - I think when finding the max LSN of single file the utility should consider all relation segments. Would you like to find

Re: [HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-26 Thread Amit Kapila
Friday, November 23, 2012 5:38 AM Muhammad Usama wrote: Hi Amit I have reviewed and tested the patch, Following are my observations and comments. Thank you for the review. I need some clarification regarding some of the comments Observations and Comments

[HACKERS] Review: Patch to compute Max LSN of Data Pages

2012-11-22 Thread Muhammad Usama
Hi Amit I have reviewed and tested the patch, Following are my observations and comments. Basic stuff - - Patch applies OK - Compiles cleanly with no warnings - All regression tests pass. Observations and Comments --- - If no option is