Обсуждение: Re: [COMMITTERS] pgsql: pgbench: Allow the transaction log file prefix to be changed.

Поиск
Список
Период
Сортировка

Re: [COMMITTERS] pgsql: pgbench: Allow the transaction log file prefix to be changed.

От
Robert Haas
Дата:
On Wed, Nov 9, 2016 at 4:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <rhaas@postgresql.org> writes:
>> pgbench: Allow the transaction log file prefix to be changed.
>
> Perhaps the "logpath" buffer that the filename is constructed in
> needs to be made bigger.  64 bytes was obviously enough with the
> old pattern, but it's not with the new.

Oops, yes, that seems like a good idea.  How about 64 -> MAXPGPATH?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: Re: [COMMITTERS] pgsql: pgbench: Allow the transaction log file prefix to be changed.

От
Tom Lane
Дата:
Robert Haas <robertmhaas@gmail.com> writes:
> On Wed, Nov 9, 2016 at 4:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Perhaps the "logpath" buffer that the filename is constructed in
>> needs to be made bigger.  64 bytes was obviously enough with the
>> old pattern, but it's not with the new.

> Oops, yes, that seems like a good idea.  How about 64 -> MAXPGPATH?

If we want to stick with the fixed-size-buffer-on-stack approach,
that would be the thing to use.  psprintf is another possibility,
though that would add a malloc/free cycle.
        regards, tom lane



Re: Re: [COMMITTERS] pgsql: pgbench: Allow the transaction log file prefix to be changed.

От
Michael Paquier
Дата:
On Thu, Nov 10, 2016 at 12:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Wed, Nov 9, 2016 at 4:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Perhaps the "logpath" buffer that the filename is constructed in
>>> needs to be made bigger.  64 bytes was obviously enough with the
>>> old pattern, but it's not with the new.
>
>> Oops, yes, that seems like a good idea.  How about 64 -> MAXPGPATH?
>
> If we want to stick with the fixed-size-buffer-on-stack approach,
> that would be the thing to use.  psprintf is another possibility,
> though that would add a malloc/free cycle.

MAXPGPATH is used quite a lot in the binaries of src/bin/, just using
that seems fine to me.. My 2c.
-- 
Michael



Re: Re: [COMMITTERS] pgsql: pgbench: Allow the transaction log file prefix to be changed.

От
Robert Haas
Дата:
On Wed, Nov 9, 2016 at 10:08 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Wed, Nov 9, 2016 at 4:51 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Perhaps the "logpath" buffer that the filename is constructed in
>>> needs to be made bigger.  64 bytes was obviously enough with the
>>> old pattern, but it's not with the new.
>
>> Oops, yes, that seems like a good idea.  How about 64 -> MAXPGPATH?
>
> If we want to stick with the fixed-size-buffer-on-stack approach,
> that would be the thing to use.  psprintf is another possibility,
> though that would add a malloc/free cycle.

I don't think the performance cost of a malloc/free cycle would be
noticeable, but I don't see much point in it, either.  It's likely
that, if you hadn't notice this by inspection, we could have gone a
few years before anyone ran afoul of the 64-character limit.  Now,
MAXPGPATH is 1024, and I do not know too many people who have a real
need for pathnames over 1024 characters.  I think we may as well just
keep it simple.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company