Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed! - Mailing list pgsql-hackers

From Tom Lane
Subject Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed!
Date
Msg-id 5455.974092895@sss.pgh.pa.us
Whole thread Raw
In response to Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed!  ("Mitch Vincent" <mitch@venux.net>)
Responses Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed!  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
"Mitch Vincent" <mitch@venux.net> writes:
> It wasn't PostgreSQL, it was me of course!
> Seeing as it was so long ago, I forgot that the BLCKSZ on the production
> server wasn't 32k, it was 31k (for whatever reason).. When I set the BLCKSZ
> lower than that and tried to start the backend it told me that the database
> was initialized with a BLCKSZ of 31k, strange that it didn't say that when I
> compiled with a BLCKSZ of 32k but regardless of all that it was my stupidity
> that was the problem, nothing more..

Hmm, there is a test specifically designed to catch this mistake in
backend/access/transam/xlog.c: the initdb-time BLCKSZ is stored in
pg_control, and we have

    if (ControlFile->blcksz != BLCKSZ)
        elog(STOP, "database was initialized with BLCKSZ %d,\n\tbut the backend was compiled with BLCKSZ %d.\n\tlooks
likeyou need to initdb.", 
             ControlFile->blcksz, BLCKSZ);

But I haven't stress-tested it.  From your report, it sounds like
something may blow up before control gets to this point if the compiled
BLCKSZ is larger than the value used by initdb :-(

            regards, tom lane

pgsql-hackers by date:

Previous
From: Michael Fork
Date:
Subject: PHPBuilder article -- Postgres vs MySQL
Next
From: Tom Lane
Date:
Subject: Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed!