Return-path: <commits-return-63498-klewis=mysql.com@lists.mysql.com>
Received: from fe-amer-09.sun.com ([unknown] [192.18.109.79])
 by amer3-mail1.central.sun.com
 (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec  9 2008))
 with ESMTP id <0KDL00KCIWQUUK70@amer3-mail1.central.sun.com> for
 kl221630@amer3-mail1.central.Sun.COM; Sat, 17 Jan 2009 01:25:42 -0700 (MST)
Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 id <0KDL00301WQUY600@mail-amer.sun.com> for
 kl221630@amer3-mail1.central.Sun.COM (ORCPT klewis@mysql.com); Sat,
 17 Jan 2009 01:25:42 -0700 (MST)
Received: from phys-amer3-2.central.sun.com ([129.147.157.45])
 by mail-amer.sun.com
 (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007))
 with ESMTP id <0KDL007H1WQTTZ80@mail-amer.sun.com> for
 kl221630@amer3-mail1.central.Sun.COM (ORCPT klewis@mysql.com); Sat,
 17 Jan 2009 01:25:41 -0700 (MST)
Received: from dm-central-01.central.sun.com ([unknown] [129.147.62.4])
 by amer3-mail1.central.sun.com
 (Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec  9 2008))
 with ESMTP id <0KDL00KCGWQTUK70@amer3-mail1.central.sun.com> for
 kl221630@amer3-mail1.central.Sun.COM (ORCPT klewis@mysql.com); Sat,
 17 Jan 2009 01:25:41 -0700 (MST)
Received: from newsunmail1brm.central.sun.com
 (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by dm-central-01.central.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.2)
 with ESMTP id n0H8PfkA009023	for <kevin.lewis@central.sun.com>; Sat,
 17 Jan 2009 01:25:41 -0700 (MST)
Received: from nwk-avmta-1.SFBay.Sun.COM
 (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])	by newsunmail1brm.central.sun.com
 (8.13.7+Sun/8.13.7/ENSMAIL,v2.2) with ESMTP id n0H8PexZ037054	for
 <@sunmail2sca.sfbay.sun.com:kevin.lewis@sun.com>; Sat,
 17 Jan 2009 01:25:41 -0700 (MST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KDL00G0HWQSR200@nwk-avmta-1.sfbay.Sun.COM> for kevin.lewis@sun.com
 (ORCPT klewis@mysql.com); Sat, 17 Jan 2009 00:25:40 -0800 (PST)
Received: from dm-xlate-02.central.sun.com ([129.147.62.12])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KDL0051RWQRPY90@nwk-avmta-1.sfbay.Sun.COM> for
 kevin.lewis@sun.com (ORCPT klewis@mysql.com); Sat,
 17 Jan 2009 00:25:40 -0800 (PST)
Received: from brmea-mail-1.sun.com (brmea-mail-1.Sun.COM [192.18.98.31])
	by dm-xlate-02.central.sun.com (8.13.8+Sun/8.13.8)
 with ESMTP id n0H8Pdhv048160	for <klewis@mysql.com>; Sat,
 17 Jan 2009 01:25:39 -0700 (MST)
Received: from relay11i.sun.com
 (ip121.net129179-4.block1.us.syntegra.com [129.179.4.121])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id n0H8Pdk7011960	for
 <klewis@mysql.com>; Sat, 17 Jan 2009 08:25:39 +0000 (GMT)
Received: from mmp11es.mmp.us.syntegra.com ([160.41.208.11] [160.41.208.11])
 by relay11i.sun.com with ESMTP id BT-MMP-2781583 for klewis@mysql.com; Sat,
 17 Jan 2009 08:25:39 +0000 (Z)
Received: from relay15i.sun.com (relay15i.sun.com [129.179.4.125])
 by mmp11es.mmp.us.syntegra.com with ESMTP id BT-MMP-66436822 for
 klewis@mysql.com; Sat, 17 Jan 2009 08:25:38 +0000 (Z)
Received: from lists.mysql.com ([213.136.52.31] [213.136.52.31])
 by relay1i.sun.com id BT-MMP-26688437 for klewis@mysql.com; Sat,
 17 Jan 2009 08:25:38 +0000 (Z)
Received: (qmail 10394 invoked by uid 510); Sat, 17 Jan 2009 08:25:36 +0000
Received: (qmail 10369 invoked by uid 509); Sat, 17 Jan 2009 08:25:36 +0000
Date: Sat, 17 Jan 2009 02:23:04 -0600 (CST)
From: Christopher Powers <Christopher.Powers@Sun.COM>
Subject: bzr commit into mysql-6.0-falcon-team branch (christopher.powers:2964)
 Bug#42131
Sender: Christopher.Powers@Sun.COM
To: commits@lists.mysql.com
Message-id: <20090117082305.6075E1DB074C@xeno.mysql.com>
X-Envelope-from: Kevin.Lewis@Sun.COM
X-Envelope-to: falcon@lists.mysql.com, jstarkey@NimbusDB.com
MIME-version: 1.0
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
Precedence: bulk
Delivered-to: mailing list commits@lists.mysql.com
Received-SPF: pass (lists.mysql.com: local policy)
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Spam-Check-By: lists.mysql.com
X-Bug: 42131
X-CSetKey: christopher.powers@sun.com-20090117082244-4ktla0o57rurnee9
X-bzr-action: commit
X-bzr-revid: christopher.powers@sun.com-20090117082244-4ktla0o57rurnee9
X-bzr-revno: 2964
X-Cxn-Txn: 66251338,46232658
X-Antispam: No, score=-0.7/5.0, scanned in 0.113sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
Mailing-List: contact commits-help@lists.mysql.com; run by ezmlm
List-Post: <mailto:commits@lists.mysql.com>
List-Unsubscribe: <mailto:commits-unsubscribe-klewis=mysql.com@lists.mysql.com>
List-Archive: http://lists.mysql.com/commits/63498
List-Help: <mailto:commits-help@lists.mysql.com>
List-Id: <commits.mysql.com>
User-Agent: Bazaar (1.5)
Original-recipient: rfc822;klewis@mysql.com
X-Spam-Status: No, hits=0.0 required=5.0	tests=UNPARSEABLE_RELAY

#At file:///home/cpowers/work/dev/dev-03/mysql/

 2964 Christopher Powers	2009-01-17
      Bug #42131 "falcon_backlog test crashes in Record::getEncodedValue"
      
      Transaction:chill() must get an exclusive syncPrior lock before deleting record data.
modified:
  storage/falcon/Record.h
  storage/falcon/SRLUpdateRecords.cpp
  storage/falcon/SRLUpdateRecords.h
  storage/falcon/Table.h

per-file messages:
  storage/falcon/Record.h
    Disable CHECK_RECORD_ACTIVITY. This flag has not been maintained, and causes
    invalid fatal assertions.
  storage/falcon/SRLUpdateRecords.cpp
    SRLUpdateRecords::chill() now gets an exclusive syncPrior lock before
    deleting the record data of a record being chilled.
    
    To prevent a deadlock with concurrent record thaws, abandon the chill for
    any record for which the syncPrior cannot be acquired within 50ms.
    
    The presumption is that if syncPrior is held for a record chain, then
    all records should remain fully intact.
  storage/falcon/SRLUpdateRecords.h
    Change return type of SRLUpdateRecords::chill() to boolean
  storage/falcon/Table.h
    Increase size of syncPrior and syncThaw hash table
=== modified file 'storage/falcon/Record.h'
--- a/storage/falcon/Record.h	2009-01-09 22:00:52 +0000
+++ b/storage/falcon/Record.h	2009-01-17 08:22:44 +0000
@@ -27,7 +27,7 @@
 #define ALLOCATE_RECORD(n)		(char*) MemMgrRecordAllocate (n, __FILE__, __LINE__)
 #define DELETE_RECORD(record)	MemMgrRecordDelete (record);
 
-#define CHECK_RECORD_ACTIVITY
+//#define CHECK_RECORD_ACTIVITY
 
 #include "SynchronizationObject.h"
 

=== modified file 'storage/falcon/SRLUpdateRecords.cpp'
--- a/storage/falcon/SRLUpdateRecords.cpp	2008-11-19 17:00:02 +0000
+++ b/storage/falcon/SRLUpdateRecords.cpp	2009-01-17 08:22:44 +0000
@@ -28,6 +28,7 @@
 #include "Sync.h"
 #include "SerialLogWindow.h"
 #include "Format.h"
+#include "SQLError.h"
 
 SRLUpdateRecords::SRLUpdateRecords(void)
 {
@@ -37,8 +38,19 @@ SRLUpdateRecords::~SRLUpdateRecords(void
 {
 }
 
-void SRLUpdateRecords::chill(Transaction *transaction, RecordVersion *record, uint dataLength)
+bool SRLUpdateRecords::chill(Transaction *transaction, RecordVersion *record, uint dataLength)
 {
+	Sync syncPrior(record->getSyncPrior(), "SRLUpdateRecords::chill");
+	
+	try
+		{
+		syncPrior.lock(Exclusive, 50);
+		}
+	catch (...)
+		{
+		return false;
+		}
+	
 	// Record data has been written to the serial log, so release the data
 	// buffer and set the state accordingly
 	
@@ -55,6 +67,8 @@ void SRLUpdateRecords::chill(Transaction
 		transaction->totalRecordData -= dataLength;
 	else
 		transaction->totalRecordData = 0;
+		
+	return true;
 }
 
 int SRLUpdateRecords::thaw(RecordVersion *record, bool *thawed)
@@ -200,15 +214,16 @@ void SRLUpdateRecords::append(Transactio
 					{
 					int chillBytes = record->getEncodedSize();
 
-					chill(transaction, record, chillBytes);
-					
-					log->chilledRecords++;
-					log->chilledBytes += chillBytes;
+					if (chill(transaction, record, chillBytes))
+						{
+						log->chilledRecords++;
+						log->chilledBytes += chillBytes;
 					
-					ASSERT(transaction->thawedRecords > 0);
+						//ASSERT(transaction->thawedRecords > 0);
 
-					if (transaction->thawedRecords)
-						transaction->thawedRecords--;
+						if (transaction->thawedRecords)
+							transaction->thawedRecords--;
+						}
 					}
 				else
 					{
@@ -253,9 +268,11 @@ void SRLUpdateRecords::append(Transactio
 			
 			if (chillRecords && record->state != recDeleted)
 				{
-				chill(transaction, record, stream.totalLength);
-				chilledRecordsWindow++;
-				chilledBytesWindow += stream.totalLength;
+				if (chill(transaction, record, stream.totalLength))
+					{
+					chilledRecordsWindow++;
+					chilledBytesWindow += stream.totalLength;
+					}
 				}
 			} // next record version
 		

=== modified file 'storage/falcon/SRLUpdateRecords.h'
--- a/storage/falcon/SRLUpdateRecords.h	2008-11-14 02:30:11 +0000
+++ b/storage/falcon/SRLUpdateRecords.h	2009-01-17 08:22:44 +0000
@@ -33,7 +33,7 @@ public:
 	virtual void	read(void);
 	virtual void	pass2(void);
 	void			append(Transaction *transaction, RecordVersion *records, bool chillRecords = false);
-	void			chill(Transaction *transaction, RecordVersion *record, uint dataLength);
+	bool			chill(Transaction *transaction, RecordVersion *record, uint dataLength);
 	int				thaw(RecordVersion *record, bool *thawed);
 	
 	const UCHAR		*data;

=== modified file 'storage/falcon/Table.h'
--- a/storage/falcon/Table.h	2009-01-15 20:29:54 +0000
+++ b/storage/falcon/Table.h	2009-01-17 08:22:44 +0000
@@ -42,8 +42,8 @@ static const int PostCommit	= 128;
 
 static const int BL_SIZE			= 128;
 static const int FORMAT_HASH_SIZE	= 20;
-static const int SYNC_VERSIONS_SIZE	= 16;
-static const int SYNC_THAW_SIZE		= 16;
+static const int SYNC_VERSIONS_SIZE	= 32; // 16;
+static const int SYNC_THAW_SIZE		= 32; // 16;
 
 #define FOR_FIELDS(field,table)	{for (Field *field=table->fields; field; field = field->next){
 


-- 
MySQL Code Commits Mailing List
For list archives: http://lists.mysql.com/commits
To unsubscribe:    http://lists.mysql.com/commits?unsub=klewis@mysql.com



