Thread: indices are crashed after installation of rpm

indices are crashed after installation of rpm

From
Peter Keller
Date:
hello all,
we are running PostgreSQL 7.0.2 on Solaris 2.6,/x86 compiled by gcc 2.8.1.
For installation Postgres on 70 Solaris-2.6 server we built packages
(SVR4-style).

The first time we installed Postgres everything was ok. But after a new
installation of the package ( - same Postgres version! - just the starting
script changed) all indices where damaged (this is reproducible).

In the installation script the postmaster is stopped and started. Is it
possible the stopping and starting is crashing the indices,
because sometimes just stopping and starting the postmaster ist crashing the
indices (not reproducible)?

Has someone any idea what's wrong, do you need more informations?
greetings,
Peter


this ist the starting/stopping script S99postgres:

#!/bin/sh

umask 077

killdaemon()
{
        PIDs=`ps -u postgres | sed '/PID/d;s/ \{1,\}/ /g' | cut -d" " -f2 |
sort -rn`
        [ -n "$PIDs" ] && kill $PIDs
        [ -f /tmp/.s.PGSQL.5432 ] && rm -f /tmp/.s.PGSQL.5432
        echo "postmaster stopped"
}

startdaemon()
{
        su postgres -c /export/home/postgres/start_postgres
        echo "postmaster started"

        su postgres -c /export/home/postgres/chk_user \
        && su postgres -c /export/home/postgres/create_user
}

case "$1" in
        'start')
                startdaemon
                ;;
        'stop')
                killdaemon
                ;;
        'restart')
                killdaemon
                startdaemon
                ;;
        *)
                echo "Usage: $0 { start | stop | restart }"
                ;;
esac

exit 0

++++++++++++++++++++++++++
and start_postgres:


PATH=/opt/local/bin:$PATH:/opt/local/DWH/bin:.
LD_LIBRARY_PATH=/usr/openwin/lib:/usr/dt/lib:/opt/local/DWH/lib
export PATH LD_LIBRARY_PATH

PGLIB=/DWH/lib
PGDATA=$HOME/data
export PGLIB PGDATA

postmaster -i -D /export/home/postgres/data >> /tmp/postgres.log

--
        Bezirksfinanzdirektion Muenchen
              Vermessungsabteilung
...............................................................................................
 Peter Keller         :  Tel: (+49) 089-2190-2594
 Vermessungsrat      :  Fax: (+49) 089-2190-2459
 Alexandrastr. 3       :  mailto:Peter.Keller@bvv.bayern.de
 80538 Muenchen   :  web: http://www.bayern.de/vermessung

Sie finden uns:
http://www2.stadtplandienst.de/query;ORT=m;LL=11.591107x48.142584;GR=5;PRINTER_FRIENDLY=TRUE

******************************************************************
Bitte merken Sie sich vor:
Zum 200. Geburtstag der Bayerischen Vermessungsverwaltung
findet am Samstag, den 23. Juni 2001 von 10 bis 17 Uhr
ein Tag der offenen Tür am Staatlichen Vermessungsamt München
und am Bayerischen Landesvermessungsamt statt.
******************************************************************

Re: indices are crashed after installation of rpm

From
Tom Lane
Date:
Peter Keller <peter.keller@bvv.bayern.de> writes:
> we are running PostgreSQL 7.0.2 on Solaris 2.6,/x86 compiled by gcc 2.8.1.

> The first time we installed Postgres everything was ok. But after a new
> installation of the package ( - same Postgres version! - just the starting
> script changed) all indices where damaged (this is reproducible).

> In the installation script the postmaster is stopped and started. Is it
> possible the stopping and starting is crashing the indices,
> because sometimes just stopping and starting the postmaster ist crashing the
> indices (not reproducible)?

Do you build with --enable-locale?  If so, check to see if the
postmaster is being restarted with a different locale setting
(different LANG or LC_xxx environment variables).  Any change
in the effective sort order defined by the locale setting will
leave text indices corrupted.  Unfortunately, system boot scripts
very often run with different environment than user shells do...

7.1 has some defenses against this: the locale prevailing at initdb
time is saved, and adopted by every subsequent postmaster start.
But in older releases you just have to be careful.

            regards, tom lane

Re: indices are crashed after installation of rpm

From
jdassen@cistron.nl (J.H.M. Dassen (Ray))
Date:
Peter Keller <peter.keller@bvv.bayern.de> wrote:
>we are running PostgreSQL 7.0.2 on Solaris 2.6,/x86 compiled by gcc 2.8.1.

There are at least two components in this you might consider upgrading:
- PostgreSQL itself (to 7.0.3 or, even better, 7.1)
- gcc. Gcc 2.8.1 was a bit of a dead end in gcc development; by the time
  it was released, the EGCS development effort was quite a bit more
  advanced. The EGCS work has been incorporated into gcc 2.95(.x), and
  personally I trust gcc 2.95.3 a lot more than I'd trust 2.8.1.

HTH,
Ray
--
"My golden rule of computing is reboot your system every morning."
    Jon C.A. DeKeles, Technical Director, ZDNet AnchorDesk
    in http://www.zdnet.com/anchordesk/story/story_4100.html