Re: [HACKERS] status of concurrent VACUUM patch ...

2005-12-21 Thread Hannu Krosing
Ühel kenal päeval, K, 2005-12-21 kell 09:50, kirjutas Hannu Krosing:
 Ühel kenal päeval, T, 2005-12-20 kell 17:18, kirjutas Tom Lane:
  =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= [EMAIL PROTECTED] writes:
   i was just wondering about the status of hannu's concurrent vacuum patch.
   are there any plans to integrate this
  
  I still don't trust it (assuming that you're thinking of the same patch
  I am).
 
 What could I do to increase your trust in it ?
 
 Could you think of any specific case it could break ? Or any specific
 tests to check for it ?
 
 I attach the version of the patch for 8.1.0 for anyone interested in
 checking it.

It was pointed out to me that I did'nt.

So here it is:

---
Hannu

Index: src/backend/access/transam/twophase.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/twophase.c,v
retrieving revision 1.16
diff -c -r1.16 twophase.c
*** src/backend/access/transam/twophase.c	29 Oct 2005 00:31:50 -	1.16
--- src/backend/access/transam/twophase.c	21 Dec 2005 23:09:31 -
***
*** 279,284 
--- 279,286 
  	gxact-proc.pid = 0;
  	gxact-proc.databaseId = databaseid;
  	gxact-proc.roleId = owner;
+ 	gxact-proc.inVacuum = false;
+ 	gxact-proc.nonInVacuumXmin = InvalidTransactionId;
  	gxact-proc.lwWaiting = false;
  	gxact-proc.lwExclusive = false;
  	gxact-proc.lwWaitLink = NULL;
Index: src/backend/access/transam/xact.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xact.c,v
retrieving revision 1.215
diff -c -r1.215 xact.c
*** src/backend/access/transam/xact.c	15 Oct 2005 02:49:09 -	1.215
--- src/backend/access/transam/xact.c	21 Dec 2005 23:09:32 -
***
*** 1507,1512 
--- 1507,1514 
  		LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
  		MyProc-xid = InvalidTransactionId;
  		MyProc-xmin = InvalidTransactionId;
+ 		MyProc-inVacuum = false;	/* must be cleared with xid/xmin */
+ 		MyProc-nonInVacuumXmin = InvalidTransactionId; /* this too */
  
  		/* Clear the subtransaction-XID cache too while holding the lock */
  		MyProc-subxids.nxids = 0;
***
*** 1740,1745 
--- 1742,1749 
  	LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
  	MyProc-xid = InvalidTransactionId;
  	MyProc-xmin = InvalidTransactionId;
+ 	MyProc-inVacuum = false;	/* must be cleared with xid/xmin */
+ 	MyProc-nonInVacuumXmin = InvalidTransactionId; /* this too */
  
  	/* Clear the subtransaction-XID cache too while holding the lock */
  	MyProc-subxids.nxids = 0;
***
*** 1902,1907 
--- 1906,1913 
  		LWLockAcquire(ProcArrayLock, LW_EXCLUSIVE);
  		MyProc-xid = InvalidTransactionId;
  		MyProc-xmin = InvalidTransactionId;
+ 		MyProc-inVacuum = false;	/* must be cleared with xid/xmin */
+ 		MyProc-nonInVacuumXmin = InvalidTransactionId; /* this too */
  
  		/* Clear the subtransaction-XID cache too while holding the lock */
  		MyProc-subxids.nxids = 0;
Index: src/backend/access/transam/xlog.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.222
diff -c -r1.222 xlog.c
*** src/backend/access/transam/xlog.c	29 Oct 2005 00:31:50 -	1.222
--- src/backend/access/transam/xlog.c	21 Dec 2005 23:09:34 -
***
*** 5294,5300 
  	 * StartupSUBTRANS hasn't been called yet.
  	 */
  	if (!InRecovery)
! 		TruncateSUBTRANS(GetOldestXmin(true));
  
  	if (!shutdown)
  		ereport(DEBUG2,
--- 5294,5300 
  	 * StartupSUBTRANS hasn't been called yet.
  	 */
  	if (!InRecovery)
! 		TruncateSUBTRANS(GetOldestXmin(true, false));
  
  	if (!shutdown)
  		ereport(DEBUG2,
Index: src/backend/catalog/index.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/catalog/index.c,v
retrieving revision 1.261
diff -c -r1.261 index.c
*** src/backend/catalog/index.c	15 Oct 2005 02:49:12 -	1.261
--- src/backend/catalog/index.c	21 Dec 2005 23:09:34 -
***
*** 1427,1433 
  	else
  	{
  		snapshot = SnapshotAny;
! 		OldestXmin = GetOldestXmin(heapRelation-rd_rel-relisshared);
  	}
  
  	scan = heap_beginscan(heapRelation, /* relation */
--- 1427,1434 
  	else
  	{
  		snapshot = SnapshotAny;
! 		/* okay to ignore lazy VACUUMs here */
! 		OldestXmin = GetOldestXmin(heapRelation-rd_rel-relisshared, true);
  	}
  
  	scan = heap_beginscan(heapRelation, /* relation */
Index: src/backend/commands/vacuum.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/commands/vacuum.c,v
retrieving revision 1.317
diff -c -r1.317 vacuum.c
*** src/backend/commands/vacuum.c	15 Oct 2005 02:49:16 -	1.317
--- src/backend/commands/vacuum.c	21 Dec 2005 23:09:35 -
***
*** 36,41 
--- 36,42 
  #include executor/executor.h
  #include 

[HACKERS] status of concurrent VACUUM patch ...

2005-12-20 Thread Hans-Jürgen Schönig

i was just wondering about the status of hannu's concurrent vacuum patch.
are there any plans to integrate this or are there still improvements 
which have to be made?


many thanks,

  hans-juergen schoenig

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] status of concurrent VACUUM patch ...

2005-12-20 Thread Tom Lane
=?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= [EMAIL PROTECTED] writes:
 i was just wondering about the status of hannu's concurrent vacuum patch.
 are there any plans to integrate this

I still don't trust it (assuming that you're thinking of the same patch
I am).

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] status of concurrent VACUUM patch ...

2005-12-20 Thread Hannu Krosing
Ühel kenal päeval, T, 2005-12-20 kell 17:18, kirjutas Tom Lane:
 =?ISO-8859-1?Q?Hans-J=FCrgen_Sch=F6nig?= [EMAIL PROTECTED] writes:
  i was just wondering about the status of hannu's concurrent vacuum patch.
  are there any plans to integrate this
 
 I still don't trust it (assuming that you're thinking of the same patch
 I am).

What could I do to increase your trust in it ?

Could you think of any specific case it could break ? Or any specific
tests to check for it ?

I attach the version of the patch for 8.1.0 for anyone interested in
checking it.

--
Hannu



---(end of broadcast)---
TIP 6: explain analyze is your friend