Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. - Mailing list pgsql-general

From Bruce Momjian
Subject Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.
Date
Msg-id 200502272241.j1RMfAJ28507@candle.pha.pa.us
Whole thread Raw
In response to Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-general
Your patch has been added to the PostgreSQL unapplied patches list at:

    http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------


Ron Mayer wrote:
>
> On Fri, 25 Feb 2005, Bruce Momjian wrote:
> > Tom Lane wrote:
> > > Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> > > > Should the relation overflow be a WARNING or a LOG?  ...
> > > I'd go for making them both LOG, I think.  More consistent.
> >
> > Can we also update this wording:
> >
> > INFO:  free space map: 52 relations, 61 pages stored; 848 total pages needed
> > DETAIL:  Allocated FSM size: 1000 relations + 20000 pages = 182 kB shared memory.
> >
> > The "pages needed" is confusing.  In fact it is the total pages used or
> > allocated.  I looked in the code and got confused.  It needs clarity.
>
>
> Any preference?   To me, "allocated" has some risk of sounding like
> it refers to the total free space map (memory allocated for fsm)
> instead of just the used ones.    "Allocated" is actually used for
> that other meaning on the next line.  I guess it's confusing there
> too, so that line should be changed as well.
>
> How about if I go for "used" in that first line; and simply remove the
> word "Allocated" in the DETAIL line.
>
> So instead of:
> >
> > INFO:  free space map: 52 relations, 61 pages stored; 848 total pages needed
> > DETAIL:  Allocated FSM size: 1000 relations + 20000 pages = 182 kB shared memory.
> >
> it'll say
> >
> > INFO:  free space map: 52 relations, 61 pages stored; 848 total pages used
> > DETAIL:  FSM size: 1000 relations + 20000 pages = 182 kB shared memory.
> >
>
>
> With those changes, the patch now looks like this...
>
>
> ======================================================================
>
> % diff -u postgresql-8.0.1/src/backend/storage/freespace/freespace.c
postgresql-patched/src/backend/storage/freespace/freespace.c
> --- postgresql-8.0.1/src/backend/storage/freespace/freespace.c    2004-12-31 14:00:54.000000000 -0800
> +++ postgresql-patched/src/backend/storage/freespace/freespace.c    2005-02-25 16:45:26.773792440 -0800
> @@ -705,12 +705,25 @@
>      /* Convert stats to actual number of page slots needed */
>      needed = (sumRequests + numRels) * CHUNKPAGES;
>
> -    ereport(elevel,
> -            (errmsg("free space map: %d relations, %d pages stored; %.0f total pages needed",
> +    ereport(INFO,
> +            (errmsg("free space map: %d relations, %d pages stored; %.0f total pages used",
>                      numRels, storedPages, needed),
> -             errdetail("Allocated FSM size: %d relations + %d pages = %.0f kB shared memory.",
> +             errdetail("FSM size: %d relations + %d pages = %.0f kB shared memory.",
>                         MaxFSMRelations, MaxFSMPages,
>                         (double) FreeSpaceShmemSize() / 1024.0)));
> +
> +    if (numRels == MaxFSMRelations)
> +        ereport(LOG,
> +            (errmsg("max_fsm_relations(%d) is equal than the number of relations vacuum checked (%d)",
> +             MaxFSMRelations, numRels),
> +             errhint("You probably have more than %d relations. You should increase max_fsm_relations. Pages needed
formax_fsm_pages may have been underestimated. ",numRels))); 
> +    else
> +    if (needed > MaxFSMPages)
> +        ereport(LOG,
> +            (errmsg("max_fsm_pages(%d) is smaller than the actual number of page slots needed(%.0f)",
> +             MaxFSMPages, needed),
> +             errhint("You may want to increase max_fsm_pages to be larger than %.0f",needed)));
> +
>  }
>
>  /*
> ======================================================================
>
>
> Getting closer?
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]
Next
From: Jay Guerette
Date:
Subject: Disabling triggers in a transaction