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 5536.974093691@sss.pgh.pa.us
Whole thread Raw
In response to Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed!  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I said:
>     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 :-(

Oh ... duh!  Three statements before the above test, we read in the
pg_control data with

    if (read(fd, ControlFile, BLCKSZ) != BLCKSZ)
        elog(STOP, "Read(\"%s\") failed: %d", ControlFilePath, errno);

Now pg_control is only a one-block file anyway.  So if it was written
with a smaller BLCKSZ than the backend is expecting, the read() will
indeed not read as many bytes as the code is expecting --- whereupon
it fails with this not-so-informative error message instead of the
one that would be useful.

Easy to fix, now that we've had our noses rubbed in the problem.
Thanks for the report, and sorry you were confused for awhile...

            regards, tom lane

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 7.0.2 -> 7.0.3 problem - anyone? - Fixed!
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: RE: [COMMITTERS] pgsql/src/backend/access/transam ( xact.c xlog.c)