1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Revert DTrace patch from Robert Lor

This commit is contained in:
Bruce Momjian
2009-04-02 20:59:10 +00:00
parent 735cb9692d
commit 0e550ff617
15 changed files with 15 additions and 112 deletions

View File

@ -41,7 +41,7 @@
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.46 2009/04/02 19:14:33 momjian Exp $
* $PostgreSQL: pgsql/src/backend/access/transam/slru.c,v 1.47 2009/04/02 20:59:10 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -57,7 +57,6 @@
#include "storage/fd.h"
#include "storage/shmem.h"
#include "miscadmin.h"
#include "pg_trace.h"
/*
@ -373,7 +372,6 @@ SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok,
{
SlruShared shared = ctl->shared;
TRACE_POSTGRESQL_SLRU_READPAGE_START((uintptr_t)ctl, pageno, write_ok, xid);
/* Outer loop handles restart if we must wait for someone else's I/O */
for (;;)
{
@ -401,7 +399,6 @@ SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok,
}
/* Otherwise, it's ready to use */
SlruRecentlyUsed(shared, slotno);
TRACE_POSTGRESQL_SLRU_READPAGE_DONE(slotno);
return slotno;
}
@ -449,7 +446,6 @@ SimpleLruReadPage(SlruCtl ctl, int pageno, bool write_ok,
SlruReportIOError(ctl, pageno, xid);
SlruRecentlyUsed(shared, slotno);
TRACE_POSTGRESQL_SLRU_READPAGE_DONE(slotno);
return slotno;
}
}
@ -474,8 +470,6 @@ SimpleLruReadPage_ReadOnly(SlruCtl ctl, int pageno, TransactionId xid)
SlruShared shared = ctl->shared;
int slotno;
TRACE_POSTGRESQL_SLRU_READPAGE_READONLY((uintptr_t)ctl, pageno, xid);
/* Try to find the page while holding only shared lock */
LWLockAcquire(shared->ControlLock, LW_SHARED);
@ -517,8 +511,6 @@ SimpleLruWritePage(SlruCtl ctl, int slotno, SlruFlush fdata)
int pageno = shared->page_number[slotno];
bool ok;
TRACE_POSTGRESQL_SLRU_WRITEPAGE_START((uintptr_t)ctl, pageno, slotno);
/* If a write is in progress, wait for it to finish */
while (shared->page_status[slotno] == SLRU_PAGE_WRITE_IN_PROGRESS &&
shared->page_number[slotno] == pageno)
@ -533,10 +525,7 @@ SimpleLruWritePage(SlruCtl ctl, int slotno, SlruFlush fdata)
if (!shared->page_dirty[slotno] ||
shared->page_status[slotno] != SLRU_PAGE_VALID ||
shared->page_number[slotno] != pageno)
{
TRACE_POSTGRESQL_SLRU_WRITEPAGE_DONE();
return;
}
/*
* Mark the slot write-busy, and clear the dirtybit. After this point, a
@ -580,8 +569,6 @@ SimpleLruWritePage(SlruCtl ctl, int slotno, SlruFlush fdata)
/* Now it's okay to ereport if we failed */
if (!ok)
SlruReportIOError(ctl, pageno, InvalidTransactionId);
TRACE_POSTGRESQL_SLRU_WRITEPAGE_DONE();
}
/*
@ -606,8 +593,6 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno)
SlruFileName(ctl, path, segno);
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_START((uintptr_t)ctl, path, pageno, slotno);
/*
* In a crash-and-restart situation, it's possible for us to receive
* commands to set the commit status of transactions whose bits are in
@ -622,7 +607,6 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno)
{
slru_errcause = SLRU_OPEN_FAILED;
slru_errno = errno;
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -630,7 +614,6 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno)
(errmsg("file \"%s\" doesn't exist, reading as zeroes",
path)));
MemSet(shared->page_buffer[slotno], 0, BLCKSZ);
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_DONE(true, -1, -1);
return true;
}
@ -639,7 +622,6 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno)
slru_errcause = SLRU_SEEK_FAILED;
slru_errno = errno;
close(fd);
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -649,7 +631,6 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno)
slru_errcause = SLRU_READ_FAILED;
slru_errno = errno;
close(fd);
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -657,12 +638,9 @@ SlruPhysicalReadPage(SlruCtl ctl, int pageno, int slotno)
{
slru_errcause = SLRU_CLOSE_FAILED;
slru_errno = errno;
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
TRACE_POSTGRESQL_SLRU_READPAGE_PHYSICAL_DONE(true, -1, -1);
return true;
}
@ -690,8 +668,6 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruFlush fdata)
char path[MAXPGPATH];
int fd = -1;
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_START((uintptr_t)ctl, pageno, slotno);
/*
* Honor the write-WAL-before-data rule, if appropriate, so that we do not
* write out data before associated WAL records. This is the same action
@ -777,7 +753,6 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruFlush fdata)
{
slru_errcause = SLRU_OPEN_FAILED;
slru_errno = errno;
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -806,7 +781,6 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruFlush fdata)
slru_errno = errno;
if (!fdata)
close(fd);
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -820,7 +794,6 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruFlush fdata)
slru_errno = errno;
if (!fdata)
close(fd);
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -835,7 +808,6 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruFlush fdata)
slru_errcause = SLRU_FSYNC_FAILED;
slru_errno = errno;
close(fd);
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
@ -843,12 +815,10 @@ SlruPhysicalWritePage(SlruCtl ctl, int pageno, int slotno, SlruFlush fdata)
{
slru_errcause = SLRU_CLOSE_FAILED;
slru_errno = errno;
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_DONE(false, slru_errcause, slru_errno);
return false;
}
}
TRACE_POSTGRESQL_SLRU_WRITEPAGE_PHYSICAL_DONE(true, -1, -1);
return true;
}