Re: small pg_basebackup display bug

Lists: pgsql-hackers
From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: pgsql-hackers(at)postgresql(dot)org
Subject: small pg_basebackup display bug
Date: 2012-12-15 10:39:22
Message-ID: 9bfbac95eecfb2aa61254c62f0face74.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

from 9.3devel (this morning):

There is a small bug in pg_basebackup: it displays a truncated part of what seems to be the new
$PGDATA (the source code has 'filename' there, but I don't see what's supposed to be in there).

The truncated name in parentheses only shows up during the filling of the new PGDATA; when 100% is
reached that part of the displayed name is deleted. That's another bug in itself, I think:
shouldn't the end-state of that line also display the parenthesized name?

Below is output that shows what I mean: I got that by entering <ENTER> e few times while
pg_basebackup was running

$ pg_basebackup -v -P -D /home/aardvark/pg_stuff/pg_installations/pgsql.93_3pulls2/data
19377/55092 kB (35%), 0/1 tablespace (/home/aardvark/pg_stuff/pg_ins)
45859/55092 kB (83%), 0/1 tablespace (/home/aardvark/pg_stuff/pg_ins)
55101/55101 kB (100%), 1/1 tablespace
pg_basebackup: base backup completed

Thanks,

Erik Rijkers


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small pg_basebackup display bug
Date: 2012-12-15 13:10:02
Message-ID: CABUevEztMY1abrPtHfTVyd1L3QXUaJYe8htx=WQ4JvXhn5X9TQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Dec 15, 2012 at 11:39 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
> from 9.3devel (this morning):

Is this different from 9.2 and earlier?

> There is a small bug in pg_basebackup: it displays a truncated part of what seems to be the new
> $PGDATA (the source code has 'filename' there, but I don't see what's supposed to be in there).

It is the full name of the file. If the path is too long it gets
truncated before it gets to the actual filename, of course, so it
looks to be the directory.

> The truncated name in parentheses only shows up during the filling of the new PGDATA; when 100% is
> reached that part of the displayed name is deleted. That's another bug in itself, I think:
> shouldn't the end-state of that line also display the parenthesized name?

Those are both intentional. It may be argued that the intention shoud
be changed :), but it's not a bug in itself - it's acting like
intended.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: "Magnus Hagander" <magnus(at)hagander(dot)net>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small pg_basebackup display bug
Date: 2012-12-15 13:24:05
Message-ID: dab6ed3ce5e099989276f334e8b18c4e.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, December 15, 2012 14:10, Magnus Hagander wrote:
> On Sat, Dec 15, 2012 at 11:39 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>> from 9.3devel (this morning):
>
>
>> The truncated name in parentheses only shows up during the filling of the new PGDATA; when 100%
>> is
>> reached that part of the displayed name is deleted. That's another bug in itself, I think:
>> shouldn't the end-state of that line also display the parenthesized name?
>
> Those are both intentional. It may be argued that the intention shoud
> be changed :), but it's not a bug in itself - it's acting like
> intended.
>

Fair enough. How about just changing the possible length to enable display somewhat longer names
like I used? It truncates to 30 characters; perhaps something like 100 would be more reasonable?
That would make such a truncation less frequent, and after all a truncated display is not
particular useful.

Thanks,

Erik Rijkers


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small pg_basebackup display bug
Date: 2012-12-16 17:21:28
Message-ID: CABUevEz3tP-95PGcMjSdLtEwO2BifduAomvYzfW=8KwApTdPJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sat, Dec 15, 2012 at 2:24 PM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
> On Sat, December 15, 2012 14:10, Magnus Hagander wrote:
>> On Sat, Dec 15, 2012 at 11:39 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>>> from 9.3devel (this morning):
>>
>>
>>> The truncated name in parentheses only shows up during the filling of the new PGDATA; when 100%
>>> is
>>> reached that part of the displayed name is deleted. That's another bug in itself, I think:
>>> shouldn't the end-state of that line also display the parenthesized name?
>>
>> Those are both intentional. It may be argued that the intention shoud
>> be changed :), but it's not a bug in itself - it's acting like
>> intended.
>>
>
> Fair enough. How about just changing the possible length to enable display somewhat longer names
> like I used? It truncates to 30 characters; perhaps something like 100 would be more reasonable?

The general idea with the selection was that it shouldn't truncate on
a "normal terminal". 30 might be a bit on the aggressive side, but 100
would be guaranteed to almost always do it (since there is also other
text on the line than just the filename). I'm not sure if we can
figure out the size of the screen in a platform independent way
without going through a lot of extra work though - but maybe we can?

> That would make such a truncation less frequent, and after all a truncated display is not
> particular useful.

Agreed - it's useful during testing, but not in a typical production
use. It might actually be more useful if it's truncated in in the
other end (keeping the last 30 instead of the first 30 chars)

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Erik Rijkers <er(at)xs4all(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small pg_basebackup display bug
Date: 2012-12-16 18:20:53
Message-ID: 17451.1355682053@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Sat, Dec 15, 2012 at 2:24 PM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>> That would make such a truncation less frequent, and after all a truncated display is not
>> particular useful.

> Agreed - it's useful during testing, but not in a typical production
> use. It might actually be more useful if it's truncated in in the
> other end (keeping the last 30 instead of the first 30 chars)

+1 for truncating from the left. I think pg_upgrade already does that
in its progress messages.

regards, tom lane


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Erik Rijkers <er(at)xs4all(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small pg_basebackup display bug
Date: 2012-12-18 00:30:08
Message-ID: 20121218003008.GA29144@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Dec 16, 2012 at 01:20:53PM -0500, Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > On Sat, Dec 15, 2012 at 2:24 PM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
> >> That would make such a truncation less frequent, and after all a truncated display is not
> >> particular useful.
>
> > Agreed - it's useful during testing, but not in a typical production
> > use. It might actually be more useful if it's truncated in in the
> > other end (keeping the last 30 instead of the first 30 chars)
>
> +1 for truncating from the left. I think pg_upgrade already does that
> in its progress messages.

Yes, it does in the current git tree.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Erik Rijkers <er(at)xs4all(dot)nl>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: small pg_basebackup display bug
Date: 2013-01-17 13:46:20
Message-ID: CABUevEyrpT+MDo4=vY5wPXjofFAgPS8iP2ktdv_yG_HNFL_1YQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Sun, Dec 16, 2012 at 7:20 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> On Sat, Dec 15, 2012 at 2:24 PM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:
>>> That would make such a truncation less frequent, and after all a truncated display is not
>>> particular useful.
>
>> Agreed - it's useful during testing, but not in a typical production
>> use. It might actually be more useful if it's truncated in in the
>> other end (keeping the last 30 instead of the first 30 chars)
>
> +1 for truncating from the left. I think pg_upgrade already does that
> in its progress messages.

Fixed. I also fixed the output of the size parameter to be a fixed
length, so the whole row doesn't shift left and right depending on how
far long the process is.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/