Search Postgresql Archives

Re: Tracking down log segment corruption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gordon Shannon <gordo169@xxxxxxxxx> writes:
> In any case, I will cease and desist from ALTER SET TABLESPACE for a while!.

Here's the applied patch, if you are interested in testing it.

			regards, tom lane

Index: src/backend/access/heap/heapam.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v
retrieving revision 1.277.2.1
diff -c -r1.277.2.1 heapam.c
*** src/backend/access/heap/heapam.c	24 Aug 2009 02:18:40 -0000	1.277.2.1
--- src/backend/access/heap/heapam.c	2 May 2010 22:19:04 -0000
***************
*** 4195,4202 ****
  	 * Note: the NEWPAGE log record is used for both heaps and indexes, so do
  	 * not do anything that assumes we are touching a heap.
  	 */
! 	buffer = XLogReadBuffer(xlrec->node, xlrec->blkno, true);
  	Assert(BufferIsValid(buffer));
  	page = (Page) BufferGetPage(buffer);
  
  	Assert(record->xl_len == SizeOfHeapNewpage + BLCKSZ);
--- 4195,4204 ----
  	 * Note: the NEWPAGE log record is used for both heaps and indexes, so do
  	 * not do anything that assumes we are touching a heap.
  	 */
! 	buffer = XLogReadBufferExtended(xlrec->node, xlrec->forknum, xlrec->blkno,
! 									RBM_ZERO);
  	Assert(BufferIsValid(buffer));
+ 	LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
  	page = (Page) BufferGetPage(buffer);
  
  	Assert(record->xl_len == SizeOfHeapNewpage + BLCKSZ);
-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux