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

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

From
Bruce Momjian
Date:
[ Previous version removed.]

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 Sun, 27 Feb 2005, Simon Riggs wrote:
> > On Fri, 2005-02-25 at 16:48 -0800, Ron Mayer wrote:
> > > Getting closer?
> > For me, yes.  [...]
> > The not-warnings seem a little wordy for me, but they happen when and
> > how I would hope for.
> >
> > So, for me, it looks like a polish of final wording and commit.
>
> Thanks for the feedback.  How about I replace the grammatically poor:
>
>  LOG:  max_fsm_relations(%d) is equal than the number of relations vacuum checked (%d)",
>  HINT:  You probably have more than %d relations. You should increase max_fsm_relations. Pages needed for
> max_fsm_pages may have been underestimated.
>
> with this:
>
>  LOG:  max_fsm_relations(100) equals the number of relations checked
>  HINT:  You have >= 100 relations. You should increase max_fsm_relations.
>
>
> and replace this:
>
>  LOG:  max_fsm_pages(%d) is smaller than the actual number of page slots needed(%.0f)",
>  HINT:  You may want to increase max_fsm_pages to be larger than %.0f"
>
> with the slightly smaller
>
>  LOG:  the number of page slots needed (2832) exceeds max_fsm_pages (1601)
>  HINT:  You may want to increase max_fsm_pages to a value over 2832.
>
>
> These updated messages would fit on an 80-column display if the numbers
> aren't too big.   Here's 80 characters for a quick reference.
>  01234567890123456789012345678901234567890123456789012345678901234567890123456789
> The "pages needed...underestimate" in the first message was no longer
> useful anyway; since it's no longer logging fsm_pages stuff when the
> max_fsm_relations condition occurred anyway
>
>   Ron
>
> The patch now looks like:
>
> ================================================================================
> % 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-27 11:54:39.776546200 -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) equals the number of relations checked",
> +             MaxFSMRelations),
> +             errhint("You have >= %d relations. You should increase max_fsm_relations.",numRels)));
> +    else
> +    if (needed > MaxFSMPages)
> +        ereport(LOG,
> +            (errmsg("the number of page slots needed (%.0f) exceeds max_fsm_pages (%d)",
> +             needed,MaxFSMPages),
> +             errhint("You may want to increase max_fsm_pages to a value over %.0f.",needed)));
> +
>  }
>
>  /*
> %
> ================================================================================
>

--
  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