Why need XLogReadBuffer have the paramter "init"? - Mailing list pgsql-hackers

From Jacky Leng
Subject Why need XLogReadBuffer have the paramter "init"?
Date
Msg-id evi3bs$vb9$1@news.hub.org
Whole thread Raw
Responses Re: Why need XLogReadBuffer have the paramter "init"?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Cann't we remove this param?
We can rewrite like this:
1.XLogReadBuffer: * remove init; * everytime we cann't read a block, just "log_invalid_page" it, and return
InvalidBuffer;
2.Also rewrite all functions calling XLogReadBuffer with "init=true": skip
current block if XLogReadBuffer return InvalidBuffer. e.g. replace
Assert(BufferIsValid(buffer)) with: * if (!BufferIsValid(buffer))        return;

Is there any harm?


Another question: if oid counter wraparound occured, and one relfilenode was
reused, e.g. see the following sequece:
1. Once there was a rel with oid XXXX;
2. Then it's dropped;
3. Then OIDs counter wraparound occured;
4. Another rel was created, and reused oid XXXX;


If there's no checkpoint since the first step, and system crashes after step
4, is it possible that the new rel's data be destroyed?




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Question about SHM_QUEUE
Next
From: Andrew Dunstan
Date:
Subject: Re: conflicting gettimeofday with MinGW