concurrent_vacuum.v802.diff
text/x-patch
Filename: concurrent_vacuum.v802.diff
Type: text/x-patch
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
Series: patch v802
| File | + | − |
|---|---|---|
| src/backend/access/transam/xact.c | 0 | 8 |
| src/backend/commands/vacuum.c | 0 | 13 |
| src/backend/storage/ipc/sinval.c | 2 | 6 |
| src/include/storage/proc.h | 0 | 5 |
diff -c -r postgresql-8.0.2/src/backend/access/transam/xact.c postgresql-8.0.2.orig/src/backend/access/transam/xact.c
*** postgresql-8.0.2/src/backend/access/transam/xact.c 2005-05-07 22:42:03.000000000 +0300
--- postgresql-8.0.2.orig/src/backend/access/transam/xact.c 2004-12-31 23:59:29.000000000 +0200
***************
*** 1411,1424 ****
AfterTriggerBeginXact();
/*
- * mark the transaction as not VACUUM (vacuum_rel will set isVacuum to true
- * directly after calling BeginTransactionCommand() )
- */
- if (MyProc != NULL)
- {
- MyProc->inVacuum = false;
- }
- /*
* done with start processing, set current transaction state to "in
* progress"
*/
--- 1411,1416 ----
diff -c -r postgresql-8.0.2/src/backend/commands/vacuum.c postgresql-8.0.2.orig/src/backend/commands/vacuum.c
*** postgresql-8.0.2/src/backend/commands/vacuum.c 2005-05-08 00:36:55.000000000 +0300
--- postgresql-8.0.2.orig/src/backend/commands/vacuum.c 2004-12-31 23:59:42.000000000 +0200
***************
*** 37,43 ****
#include "miscadmin.h"
#include "storage/buf_internals.h"
#include "storage/freespace.h"
- #include "storage/proc.h"
#include "storage/sinval.h"
#include "storage/smgr.h"
#include "tcop/pquery.h"
--- 37,42 ----
***************
*** 424,434 ****
if (use_own_xacts)
{
StartTransactionCommand();
- if (MyProc != NULL) /* is this needed here ? */
- {
- /* so other vacuums don't look at our xid/xmin in GetOldestXmin() */
- MyProc->inVacuum = true;
- }
/* functions in indexes may want a snapshot set */
ActiveSnapshot = CopySnapshot(GetTransactionSnapshot());
}
--- 423,428 ----
***************
*** 892,904 ****
/* Begin a transaction for vacuuming this relation */
StartTransactionCommand();
-
- if (MyProc != NULL) /* is this needed here ? */
- {
- /* so other vacuums don't look at our xid/xmin in GetOldestXmin() */
- MyProc->inVacuum = true;
- }
-
/* functions in indexes may want a snapshot set */
ActiveSnapshot = CopySnapshot(GetTransactionSnapshot());
--- 886,891 ----
diff -c -r postgresql-8.0.2/src/backend/storage/ipc/sinval.c postgresql-8.0.2.orig/src/backend/storage/ipc/sinval.c
*** postgresql-8.0.2/src/backend/storage/ipc/sinval.c 2005-05-07 22:55:45.000000000 +0300
--- postgresql-8.0.2.orig/src/backend/storage/ipc/sinval.c 2005-01-01 00:00:56.000000000 +0200
***************
*** 697,703 ****
{
PGPROC *proc = (PGPROC *) MAKE_PTR(pOffset);
! if ((proc->inVacuum == false) && (allDbs || proc->databaseId == MyDatabaseId))
{
/* Fetch xid just once - see GetNewTransactionId */
TransactionId xid = proc->xid;
--- 697,703 ----
{
PGPROC *proc = (PGPROC *) MAKE_PTR(pOffset);
! if (allDbs || proc->databaseId == MyDatabaseId)
{
/* Fetch xid just once - see GetNewTransactionId */
TransactionId xid = proc->xid;
***************
*** 845,858 ****
* them as running anyway. We also assume that such xacts
* can't compute an xmin older than ours, so they needn't be
* considered in computing globalxmin.
- *
- * there is also no need to consider transaxtions runnibg the
- * vacuum command as it will not affect tuple visibility
*/
if (proc == MyProc ||
!TransactionIdIsNormal(xid) ||
! TransactionIdFollowsOrEquals(xid, xmax) ||
! proc->inVacuum == true )
continue;
if (TransactionIdPrecedes(xid, xmin))
--- 845,854 ----
* them as running anyway. We also assume that such xacts
* can't compute an xmin older than ours, so they needn't be
* considered in computing globalxmin.
*/
if (proc == MyProc ||
!TransactionIdIsNormal(xid) ||
! TransactionIdFollowsOrEquals(xid, xmax))
continue;
if (TransactionIdPrecedes(xid, xmin))
diff -c -r postgresql-8.0.2/src/include/storage/proc.h postgresql-8.0.2.orig/src/include/storage/proc.h
*** postgresql-8.0.2/src/include/storage/proc.h 2005-05-07 23:26:46.000000000 +0300
--- postgresql-8.0.2.orig/src/include/storage/proc.h 2005-01-01 00:03:42.000000000 +0200
***************
*** 63,73 ****
* were starting our xact: vacuum must not
* remove tuples deleted by xid >= xmin ! */
- bool inVacuum; /* true if current command is vacuum.
- * xid or xmin of other vacuum commands
- * need not be used when
- * finding global xmin for removing tuples */
-
int pid; /* This backend's process id */
Oid databaseId; /* OID of database this backend is using */
--- 63,68 ----