Below is the list of changes that have just been committed into a local
6.0 repository of . When does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-02-14 16:06:10-05:00, jas@rowvwade. +14 -0
Added code to having rolled back chilled savepoints. The
savepoint is now written into chilling SRLUpdateRecords,
tracked by SRLSavepointRollback, managed by SerialLogTransaction.
storage/falcon/BackLog.cpp@stripped, 2008-02-14 16:06:00-05:00, jas@rowvwade. +41 -0
New BitKeeper file ``storage/falcon/BackLog.cpp''
storage/falcon/BackLog.cpp@stripped, 2008-02-14 16:06:00-05:00, jas@rowvwade. +0 -0
storage/falcon/BackLog.h@stripped, 2008-02-14 16:06:00-05:00, jas@rowvwade. +34 -0
New BitKeeper file ``storage/falcon/BackLog.h''
storage/falcon/BackLog.h@stripped, 2008-02-14 16:06:00-05:00, jas@rowvwade. +0 -0
storage/falcon/CMakeLists.txt@stripped, 2008-02-14 16:05:56-05:00, jas@rowvwade. +4 -0
Added files for new class SRLSavepointRollback. Also for
class BackLog, though it isn't used yet.
storage/falcon/Makefile.am@stripped, 2008-02-14 16:05:57-05:00, jas@rowvwade. +6 -1
Added files for new class SRLSavepointRollback. Also for
class BackLog, though it isn't used yet.
storage/falcon/SRLSavepointRollback.cpp@stripped, 2008-02-14 16:06:01-05:00, jas@rowvwade. +48 -0
New BitKeeper file ``storage/falcon/SRLSavepointRollback.cpp''
storage/falcon/SRLSavepointRollback.cpp@stripped, 2008-02-14 16:06:01-05:00, jas@rowvwade. +0 -0
storage/falcon/SRLSavepointRollback.h@stripped, 2008-02-14 16:06:01-05:00, jas@rowvwade. +34 -0
New BitKeeper file ``storage/falcon/SRLSavepointRollback.h''
storage/falcon/SRLSavepointRollback.h@stripped, 2008-02-14 16:06:01-05:00, jas@rowvwade. +0 -0
storage/falcon/SRLUpdateRecords.cpp@stripped, 2008-02-14 16:05:57-05:00, jas@rowvwade. +27 -1
Added code to having rolled back chilled savepoints. The
savepoint is now written into chilling SRLUpdateRecords,
tracked by SRLSavepointRollback, managed by SerialLogTransaction.
storage/falcon/SRLUpdateRecords.h@stripped, 2008-02-14 16:05:58-05:00, jas@rowvwade. +1 -0
Added code to having rolled back chilled savepoints. The
savepoint is now written into chilling SRLUpdateRecords,
tracked by SRLSavepointRollback, managed by SerialLogTransaction.
storage/falcon/SRLVersion.h@stripped, 2008-02-14 16:05:58-05:00, jas@rowvwade. +2 -1
Added new serial log version to support savedpoint id logging
for SRLUpdateRecords.
storage/falcon/SerialLogControl.cpp@stripped, 2008-02-14 16:05:58-05:00, jas@rowvwade. +3 -0
Added new serial log record type for logging rolled back
chilled savepoints.
storage/falcon/SerialLogControl.h@stripped, 2008-02-14 16:05:59-05:00, jas@rowvwade. +2 -0
Added new serial log record type for logging rolled back
chilled savepoints.
storage/falcon/SerialLogRecord.h@stripped, 2008-02-14 16:05:59-05:00, jas@rowvwade. +2 -1
Added new serial log record type for logging rolled back
chilled savepoints.
storage/falcon/SerialLogTransaction.h@stripped, 2008-02-14 16:05:59-05:00, jas@rowvwade. +4 -0
Added code to track rolled back savepoints.
storage/falcon/Transaction.cpp@stripped, 2008-02-14 16:06:00-05:00, jas@rowvwade. +6 -7
Log rollback of savepoints containing chilled records.
diff -Nrup a/storage/falcon/BackLog.cpp b/storage/falcon/BackLog.cpp
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/storage/falcon/BackLog.cpp 2008-02-14 16:06:00 -05:00
@@ -0,0 +1,41 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include "Engine.h"
+#include "BackLog.h"
+#include "Database.h"
+#include "Dbb.h"
+#include "Section.h"
+#include "Index.h"
+#include "IndexRootPage.h"
+#include "Transaction.h"
+
+#ifdef _DEBUG
+#undef THIS_FILE
+static const char THIS_FILE[]=__FILE__;
+#endif
+
+BackLog::BackLog(Database *db)
+{
+ database = db;
+ dbb = new Dbb(database);
+ section = new Section(dbb, 0, NO_TRANSACTION);
+}
+
+BackLog::~BackLog(void)
+{
+ delete section;
+ delete dbb;
+}
diff -Nrup a/storage/falcon/BackLog.h b/storage/falcon/BackLog.h
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/storage/falcon/BackLog.h 2008-02-14 16:06:00 -05:00
@@ -0,0 +1,34 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef _BACKLOG_H_
+#define _BACKLOG_H_
+
+class Database;
+class Dbb;
+class Section;
+
+class BackLog
+{
+public:
+ BackLog(Database *database);
+ virtual ~BackLog(void);
+
+ Database *database;
+ Dbb *dbb;
+ Section *section;
+};
+
+#endif
diff -Nrup a/storage/falcon/CMakeLists.txt b/storage/falcon/CMakeLists.txt
--- a/storage/falcon/CMakeLists.txt 2007-11-29 16:00:49 -05:00
+++ b/storage/falcon/CMakeLists.txt 2008-02-14 16:05:56 -05:00
@@ -35,6 +35,7 @@ ADD_LIBRARY(ha_falcon
Alias.cpp
AsciiBlob.cpp
BDB.cpp
+ BackLog.cpp
BigInt.cpp
BigInteger.cpp
BinaryBlob.cpp
@@ -245,6 +246,7 @@ ADD_LIBRARY(ha_falcon
SRLRecordStub.cpp
SRLRollback.cpp
SRLRecordLocator.cpp
+ SRLSavepointRollback.cpp
SRLSectionLine.cpp
SRLSectionPage.cpp
SRLSectionPromotion.cpp
@@ -298,6 +300,7 @@ ADD_LIBRARY(ha_falcon
View.cpp
WString.cpp
AsciiBlob.h
+ BackLog.h
BDB.h
BigInt.h
BigInteger.h
@@ -519,6 +522,7 @@ ADD_LIBRARY(ha_falcon
SRLRecordStub.h
SRLRollback.h
SRLRecordLocator.h
+ SRLSavepointRollback.h
SRLSectionLine.h
SRLSectionPage.h
SRLSectionPromotion.h
diff -Nrup a/storage/falcon/Makefile.am b/storage/falcon/Makefile.am
--- a/storage/falcon/Makefile.am 2007-12-18 23:32:03 -05:00
+++ b/storage/falcon/Makefile.am 2008-02-14 16:05:57 -05:00
@@ -26,7 +26,9 @@ INCLUDES= -I$(top_srcdir)/include -I$(to
-I$(srcdir) -I$(srcdir)/TransformLib @ZLIB_INCLUDES@
falcon_headers= Agent.h Alias.h Application.h \
- AsciiBlob.h BDB.h \
+ AsciiBlob.h \
+ BackLog.h \
+ BDB.h \
BigInt.h \
BigInteger.h \
BinaryBlob.h Bitmap.h Blob.h BlobReference.h Btn.h Cache.h \
@@ -145,6 +147,7 @@ falcon_headers= Agent.h Alias.h Applicat
SRLOverflowPages.h \
SRLPrepare.h \
SRLRecordLocator.h \
+ SRLSavepointRollback.h \
SRLSectionLine.h \
SRLSectionPage.h \
SRLSectionPromotion.h \
@@ -189,6 +192,7 @@ falcon_headers= Agent.h Alias.h Applicat
WString.h
falcon_sources= Agent.cpp Alias.cpp \
AsciiBlob.cpp \
+ BackLog.cpp \
BDB.cpp \
BigInt.cpp \
BigInteger.cpp \
@@ -314,6 +318,7 @@ falcon_sources= Agent.cpp Alias.cpp \
SRLRecordStub.cpp \
SRLRollback.cpp \
SRLRecordLocator.cpp \
+ SRLSavepointRollback.cpp \
SRLSectionLine.cpp \
SRLSectionPage.cpp \
SRLSectionPromotion.cpp \
diff -Nrup a/storage/falcon/SRLSavepointRollback.cpp b/storage/falcon/SRLSavepointRollback.cpp
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/storage/falcon/SRLSavepointRollback.cpp 2008-02-14 16:06:01 -05:00
@@ -0,0 +1,48 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#include <stdio.h>
+#include "Engine.h"
+#include "SRLSavepointRollback.h"
+#include "SerialLogTransaction.h"
+
+SRLSavepointRollback::SRLSavepointRollback(void)
+{
+}
+
+SRLSavepointRollback::~SRLSavepointRollback(void)
+{
+}
+
+void SRLSavepointRollback::append(TransId transactionId, int savepointId)
+{
+ START_RECORD(srlSavepointRollback, "SRLUpdateRecords::SRLSavepointRollback");
+ SerialLogTransaction *transaction = log->getTransaction(transactionId);
+ transaction->savepointRolledBack(savepointId);
+ putInt(transactionId);
+ putInt(savepointId);
+}
+
+void SRLSavepointRollback::read(void)
+{
+ transactionId = getInt();
+ savepointId = getInt();
+}
+
+void SRLSavepointRollback::pass1(void)
+{
+ SerialLogTransaction *transaction = log->getTransaction(transactionId);
+ transaction->savepointRolledBack(savepointId);
+}
diff -Nrup a/storage/falcon/SRLSavepointRollback.h b/storage/falcon/SRLSavepointRollback.h
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/storage/falcon/SRLSavepointRollback.h 2008-02-14 16:06:01 -05:00
@@ -0,0 +1,34 @@
+/* Copyright (C) 2008 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef _SRL_SAVEPOINT_ROLLBACK_H_
+#define _SRL_SAVEPOINT_ROLLBACK_H_
+
+#include "SerialLogRecord.h"
+
+class SRLSavepointRollback : public SerialLogRecord
+{
+public:
+ SRLSavepointRollback(void);
+ ~SRLSavepointRollback(void);
+ void append(TransId transactionId, int savepointId);
+ virtual void read(void);
+ virtual void pass1(void);
+
+ TransId transactionId;
+ int savepointId;
+};
+
+#endif
diff -Nrup a/storage/falcon/SRLUpdateRecords.cpp b/storage/falcon/SRLUpdateRecords.cpp
--- a/storage/falcon/SRLUpdateRecords.cpp 2008-02-08 11:32:32 -05:00
+++ b/storage/falcon/SRLUpdateRecords.cpp 2008-02-14 16:05:57 -05:00
@@ -16,6 +16,7 @@
#include <stdio.h>
#include "Engine.h"
#include "SRLUpdateRecords.h"
+#include "SRLVersion.h"
#include "Stream.h"
#include "Table.h"
#include "SerialLogControl.h"
@@ -118,6 +119,7 @@ void SRLUpdateRecords::append(Transactio
uint32 chilledBytesWindow = 0;
uint32 windowNumber = 0;
SerialLogTransaction *srlTrans = NULL;
+ int savepointId;
for (RecordVersion *record = records; record;)
{
@@ -130,6 +132,8 @@ void SRLUpdateRecords::append(Transactio
}
putInt(transaction->transactionId);
+ savepointId = (chillRecords) ? record->savePointId : 0;
+ putInt(savepointId);
UCHAR *lengthPtr = putFixedInt(0);
UCHAR *start = log->writePtr;
UCHAR *end = log->writeWarningTrack;
@@ -158,6 +162,11 @@ void SRLUpdateRecords::append(Transactio
if (record->state == recNoChill)
continue;
+ // If this is a different savepoint, start another record
+
+ if (chillRecords && record->savePointId != savepointId)
+ break;
+
Table *table = record->format->table;
tableSpaceId = table->dbb->tableSpaceId;
Stream stream;
@@ -239,6 +248,12 @@ void SRLUpdateRecords::append(Transactio
void SRLUpdateRecords::read(void)
{
transactionId = getInt();
+
+ if (control->version >= srlVersion13)
+ savepointId = getInt();
+ else
+ savepointId = 0;
+
dataLength = getInt();
data = getData(dataLength);
}
@@ -246,6 +261,9 @@ void SRLUpdateRecords::read(void)
void SRLUpdateRecords::redo(void)
{
SerialLogTransaction *transaction = control->getTransaction(transactionId);
+
+ if (savepointId != 0 && transaction->isRolledBackSavepoint(savepointId))
+ return;
if (transaction->state == sltCommitted)
for (const UCHAR *p = data, *end = data + dataLength; p < end;)
@@ -314,6 +332,14 @@ void SRLUpdateRecords::pass2(void)
void SRLUpdateRecords::commit(void)
{
+ if (savepointId != 0)
+ {
+ SerialLogTransaction *transaction = log->getTransaction(transactionId);
+
+ if (transaction->isRolledBackSavepoint(savepointId))
+ return;
+ }
+
Sync sync(&log->syncSections, "SRLUpdateRecords::commit");
sync.lock(Shared);
@@ -350,7 +376,7 @@ void SRLUpdateRecords::commit(void)
void SRLUpdateRecords::print(void)
{
- logPrint("UpdateRecords: transaction %d, length %d\n", transactionId, dataLength);
+ logPrint("UpdateRecords: transaction %d, savepointId %d, length %d\n", transactionId, savepointId, dataLength);
for (const UCHAR *p = data, *end = data + dataLength; p < end;)
{
diff -Nrup a/storage/falcon/SRLUpdateRecords.h b/storage/falcon/SRLUpdateRecords.h
--- a/storage/falcon/SRLUpdateRecords.h 2007-11-15 14:30:11 -05:00
+++ b/storage/falcon/SRLUpdateRecords.h 2008-02-14 16:05:58 -05:00
@@ -38,6 +38,7 @@ public:
const UCHAR *data;
int tableSpaceId;
+ int savepointId;
int dataLength;
};
diff -Nrup a/storage/falcon/SRLVersion.h b/storage/falcon/SRLVersion.h
--- a/storage/falcon/SRLVersion.h 2008-02-13 13:45:06 -05:00
+++ b/storage/falcon/SRLVersion.h 2008-02-14 16:05:58 -05:00
@@ -39,7 +39,8 @@ static const int srlVersion9 = 9; // Ad
static const int srlVersion10 = 10; // Added transaction id for drop table space July 9, 2007
static const int srlVersion11 = 11; // Added table space type (repository support) December 4, 2007
static const int srlVersion12 = 12; // Added index version number to SRLIndexPage February 13, 2008
-static const int srlCurrentVersion = srlVersion12;
+static const int srlVersion13 = 13; // Added savepoint id to SRLUpdateRecords February 14, 2008
+static const int srlCurrentVersion = srlVersion13;
class SRLVersion : public SerialLogRecord
{
diff -Nrup a/storage/falcon/SerialLogControl.cpp b/storage/falcon/SerialLogControl.cpp
--- a/storage/falcon/SerialLogControl.cpp 2008-01-24 17:52:52 -05:00
+++ b/storage/falcon/SerialLogControl.cpp 2008-02-14 16:05:58 -05:00
@@ -169,6 +169,9 @@ SerialLogRecord* SerialLogControl::getRe
case srlSmallBlob:
return &smallBlob;
+ case srlSavepointRollback:
+ return &savepointRollback;
+
default:
ASSERT(false);
}
diff -Nrup a/storage/falcon/SerialLogControl.h b/storage/falcon/SerialLogControl.h
--- a/storage/falcon/SerialLogControl.h 2007-11-21 17:10:21 -05:00
+++ b/storage/falcon/SerialLogControl.h 2008-02-14 16:05:59 -05:00
@@ -61,6 +61,7 @@
#include "SRLBlobDelete.h"
#include "SRLUpdateBlob.h"
#include "SRLSession.h"
+#include "SRLSavepointRollback.h"
#define LOW_BYTE_FLAG 0x80
@@ -135,6 +136,7 @@ public:
SRLBlobDelete blobDelete;
SRLUpdateBlob smallBlob;
SRLSession session;
+ SRLSavepointRollback savepointRollback;
};
#endif // !defined(AFX_SERIALLOGCONTROL_H__77229761_E146_4AE4_8BBC_2114F6A0FC93__INCLUDED_)
diff -Nrup a/storage/falcon/SerialLogRecord.h b/storage/falcon/SerialLogRecord.h
--- a/storage/falcon/SerialLogRecord.h 2007-11-01 16:28:44 -04:00
+++ b/storage/falcon/SerialLogRecord.h 2008-02-14 16:05:59 -05:00
@@ -70,7 +70,8 @@ static const int srlDropTableSpace = 33;
static const int srlBlobDelete = 34;
static const int srlSmallBlob = 35;
static const int srlSession = 36;
-static const int srlMax = 37;
+static const int srlSavepointRollback = 37;
+static const int srlMax = 38;
class SerialLog;
diff -Nrup a/storage/falcon/SerialLogTransaction.h b/storage/falcon/SerialLogTransaction.h
--- a/storage/falcon/SerialLogTransaction.h 2008-01-24 15:00:01 -05:00
+++ b/storage/falcon/SerialLogTransaction.h 2008-02-14 16:05:59 -05:00
@@ -36,6 +36,7 @@ enum sltState {
class SerialLog;
class SerialLogWindow;
class Transaction;
+class Bitmap;
struct SerialLogBlock;
class SerialLogTransaction //: public SerialLogAction
@@ -76,6 +77,7 @@ public:
SerialLogTransaction *prior;
SerialLogTransaction *earlier;
SerialLogTransaction *later;
+ Bitmap *rolledBackSavepoints;
bool flushing;
bool ordered;
uint64 physicalBlockNumber;
@@ -83,6 +85,8 @@ public:
uint64 maxBlockNumber;
void setTransaction(Transaction* transaction);
+ void savepointRolledBack(int savepointId);
+ bool isRolledBackSavepoint(int savepointId);
};
#endif // !defined(AFX_SERIALLOGTRANSACTION_H__33E33BBC_8622_49DB_BD48_C6D51B5A1002__INCLUDED_)
diff -Nrup a/storage/falcon/Transaction.cpp b/storage/falcon/Transaction.cpp
--- a/storage/falcon/Transaction.cpp 2008-02-08 12:58:41 -05:00
+++ b/storage/falcon/Transaction.cpp 2008-02-14 16:06:00 -05:00
@@ -41,6 +41,7 @@
#include "Thread.h"
#include "Format.h"
#include "LogLock.h"
+#include "SRLSavepointRollback.h"
extern uint falcon_lock_wait_timeout;
@@ -1054,6 +1055,9 @@ void Transaction::rollbackSavepoint(int
if ((savePoint) && (savePoint->id != savePointId))
throw SQLError(RUNTIME_ERROR, "invalid savepoint");
+ if (chilledBytes)
+ database->serialLog->logControl->savepointRollback.append(transactionId, savePointId);
+
savePoint = savePoints;
while (savePoint)
@@ -1064,8 +1068,10 @@ void Transaction::rollbackSavepoint(int
// Purge out records from this savepoint
RecordVersion *record = *savePoint->records;
+
if (record)
lastRecord = record->prevInTrans;
+
recordPtr = savePoint->records;
*recordPtr = NULL;
RecordVersion *stack = NULL;
@@ -1109,13 +1115,6 @@ void Transaction::rollbackSavepoint(int
savePoint = savePoint->next;
}
}
-
-/***
-void Transaction::scavengeRecords(int ageGroup)
-{
- scavenged = true;
-}
-***/
void Transaction::add(DeferredIndex* deferredIndex)
{
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2814) | U-ROWVWADEjas | 14 Feb |