Re: Enforce "max_wal_size/ min_wal_size must be at least twice wal_segment_size" limit while setting GUCs

From: mahendrakar s <mahendrakarforpg(at)gmail(dot)com>
To: rajesh singarapu <rajesh(dot)rs0541(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Enforce "max_wal_size/ min_wal_size must be at least twice wal_segment_size" limit while setting GUCs
Date: 2022-05-22 04:44:17
Message-ID: CABkiuWrjK9R3G3yY-4tWBbwtDkepLhjPg3R1yANP2=OsLOQ6iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Bharath,

+1.
This seems to be good idea to have checks on upper bound for the
max_wal_size and min_wal_size. We have seen customers play with these
parameters and ran into issues.
It will also be better to consider all the control parameters and have a
min/max checks on them as well.

Thanks,
Mahendrakar.

On Sat, 21 May 2022 at 23:26, rajesh singarapu <rajesh(dot)rs0541(at)gmail(dot)com>
wrote:

> Hi Bharath,
>
> Could you explain why min wal size must be at least twice but not
> equal to wal_segment_size ?
>
> thanks
> Rajesh
>
> On Sat, May 21, 2022 at 7:08 PM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >
> > Hi,
> >
> > Currently postgres allows setting any value for max_wal_size or
> > min_wal_size, not enforcing "at least twice as wal_segment_size" limit
> > [1]. This isn't a problem if the server continues to run, however, the
> > server can't come up after a crash or restart or maintenance or
> > upgrade (goes to a continuous restart loop with FATAL errors [1]).
> >
> > How about we add GUC check hooks for both max_wal_size and
> > min_wal_size where we can either emit ERROR or WARNING if values are
> > not "at least twice as wal_segment_size"?
> >
> > Thoughts?
> >
> > [1]
> > FATAL: "max_wal_size" must be at least twice "wal_segment_size"
> > FATAL: "min_wal_size" must be at least twice "wal_segment_size"
> >
> > [2]
> > ./initdb -D data
> > ./pg_ctl -D data -l logfile start
> > ./psql -c "alter system set max_wal_size='2MB'" postgres
> > ./psql -c "alter system set min_wal_size='2MB'" postgres
> > ./psql -c "select pg_reload_conf()" postgres
> > ./pg_ctl -D data -l logfile restart
> >
> > Regards,
> > Bharath Rupireddy.
> >
> >
>
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2022-05-22 04:54:27 Re: tweak to a few index tests to hits ambuildempty() routine.
Previous Message Thomas Munro 2022-05-22 04:24:16 Re: tweak to a few index tests to hits ambuildempty() routine.