Re: [Patch v2] Make block and file size for WAL and relations defined at cluster creation

From: Remi Colinet <remi(dot)colinet(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Patch v2] Make block and file size for WAL and relations defined at cluster creation
Date: 2018-01-04 22:07:30
Message-ID: CADdR5nwH6zPaBBGQ_Hcd0AmDBynCAnu+iTRwpasKhXna0RiAJw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-01-03 23:11 GMT+01:00 Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>:

> Remi Colinet wrote:
> > Hello,
> >
> > This is version 2 of the patch to make the file and block sizes for WAL
> and
> > relations, run-time configurable at initdb.
>
> I don't think this works, since we have a rule that pallocs are
> prohibited within critical section and I see that your patch changes
> some stack-allocated variables to palloc'ed. For example I think the
> heap_page_prune changes should break some test or other.
>

Thank you for the head up.

For heap_page_prune() function, the critical section starts after the
palloc() call and ends before the pfree().
Unless critical sections can be nested, we are outside such section.

For the other palloc()/pfree() uses to replace the stack allocation, either
we already have palloc()/pfree() call.
The changes consist of:

- page = (Page) palloc(BLCKSZ);
+ page = (Page) palloc(rel_blck_size);

Only one change could be suspected. This is for the async.c command.
But the change is also done outside of a critical section.

> This patch is too massive to review.
>

I understand the point.
If the patch is clean enough and does not show any regression, I will split
it into smaller parts.

Regards
Remi

> --
> Álvaro Herrera https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-01-04 22:12:41 Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256
Previous Message Alvaro Herrera 2018-01-04 22:01:33 Re: [HACKERS] Proposal: Local indexes for partitioned table