Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] A way to let Vacuum warn if FSM settings are low.
Date: 2005-02-27 22:41:10
Message-ID: 200502272241.j1RMfAJ28507@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches


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(at)cheapcomplexdevices(dot)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 for max_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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-02-27 22:50:56 Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]
Previous Message Jay Guerette 2005-02-27 22:37:16 Disabling triggers in a transaction

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-02-27 22:50:56 Re: [PATCHES] A way to let Vacuum warn if FSM settings are low. [final?]
Previous Message Bruce Momjian 2005-02-27 22:39:36 Re: [INTERFACES] bcc32.mak for libpq broken? (distro 8.0.0) (fwd)