#At file:///C:/Work/bzr/Merge/mysql-6.0-falcon-team/ based on revid:vvaintroub@stripped
3083 Kevin Lewis 2009-03-28
By adding a temporary assert in RecordVersion::getPriorVersion() that checks if the thread has a CycleLock, I was able to find 6 more call stacks that needed a CycleLock. This assert is not in this patch, but the 6 new CycleLocks are, along with a change in Database::start() that creates the CycleManager sooner and a change in StorageDatabase that consistently collects the database from the connection instead of the table.
modified:
storage/falcon/Connection.cpp
storage/falcon/Database.cpp
storage/falcon/StorageDatabase.cpp
storage/falcon/Table.cpp
=== modified file 'storage/falcon/Connection.cpp'
--- a/storage/falcon/Connection.cpp 2009-03-23 14:57:48 +0000
+++ b/storage/falcon/Connection.cpp 2009-03-28 06:05:52 +0000
@@ -53,6 +53,7 @@
#include "Configuration.h"
#include "Server.h"
#include "IOx.h"
+#include "CycleLock.h"
#ifndef STORAGE_ENGINE
#include "DataResourceLocator.h"
@@ -260,6 +261,8 @@ Transaction* Connection::getTransaction(
void Connection::commit()
{
+ CycleLock cycleLock(database);
+
Transaction *trans;
for (int n = 0; (trans = transaction); ++n)
@@ -277,6 +280,8 @@ void Connection::commit()
void Connection::rollback()
{
+ CycleLock cycleLock(database);
+
if (transaction)
{
transaction->rollback();
@@ -303,6 +308,8 @@ void Connection::transactionEnded()
void Connection::prepare(int xidSize, const UCHAR *xid)
{
+ CycleLock cycleLock(database);
+
if (transaction)
transaction->prepare(xidSize, xid);
}
=== modified file 'storage/falcon/Database.cpp'
--- a/storage/falcon/Database.cpp 2009-03-24 15:01:11 +0000
+++ b/storage/falcon/Database.cpp 2009-03-28 06:05:52 +0000
@@ -506,6 +506,7 @@ Database::Database(const char *dbName, C
void Database::start()
{
+ cycleManager = new CycleManager(this);
symbolManager = new SymbolManager;
#ifdef LICENSE
@@ -539,7 +540,6 @@ void Database::start()
transactionManager = new TransactionManager(this);
internalScheduler->addEvent(repositoryManager);
filterSetManager = new FilterSetManager(this);
- cycleManager = new CycleManager(this);
timestamp = time(NULL);
tickerThread = threads->start("Database::Database", &Database::ticker, this);
cardinalityThread = threads->start("Database::cardinalityThreadMain", &Database::cardinalityThreadMain, this);
=== modified file 'storage/falcon/StorageDatabase.cpp'
--- a/storage/falcon/StorageDatabase.cpp 2009-03-27 17:12:43 +0000
+++ b/storage/falcon/StorageDatabase.cpp 2009-03-28 06:05:52 +0000
@@ -264,7 +264,7 @@ Table* StorageDatabase::findTable(const
int StorageDatabase::insert(Connection* connection, Table* table, Stream* stream)
{
- CycleLock cycleLock(table->database);
+ CycleLock cycleLock(connection->database);
return table->insert(connection->getTransaction(), stream);
}
@@ -277,7 +277,7 @@ int StorageDatabase::nextRow(StorageTabl
Transaction *transaction = connection->getTransaction();
Record *candidate = NULL;
Record *record = NULL;
- CycleLock cycleLock(table->database);
+ CycleLock cycleLock(connection->database);
try
{
@@ -423,7 +423,7 @@ int StorageDatabase::nextIndexed(Storage
Table *table = storageTable->share->table;
Transaction *transaction = connection->getTransaction();
Record *candidate = NULL;
- CycleLock cycleLock(table->database);
+ CycleLock cycleLock(connection->database);
try
{
@@ -550,6 +550,8 @@ int StorageDatabase::savepointSet(Connec
int StorageDatabase::savepointRollback(Connection* connection, int savePoint)
{
+ CycleLock cycleLock(connection->database);
+
Transaction *transaction = connection->getTransaction();
transaction->rollbackSavepoint(savePoint);
@@ -558,6 +560,8 @@ int StorageDatabase::savepointRollback(C
int StorageDatabase::savepointRelease(Connection* connection, int savePoint)
{
+ CycleLock cycleLock(connection->database);
+
Transaction *transaction = connection->getTransaction();
transaction->releaseSavepoint(savePoint);
@@ -653,7 +657,7 @@ int StorageDatabase::deleteRow(StorageCo
Connection *connection = storageConnection->connection;
Transaction *transaction = connection->transaction;
Record *candidate = NULL, *record = NULL;
- CycleLock cycleLock(table->database);
+ CycleLock cycleLock(connection->database);
try
{
@@ -723,7 +727,7 @@ int StorageDatabase::deleteRow(StorageCo
int StorageDatabase::updateRow(StorageConnection* storageConnection, Table* table, Record *oldRecord, Stream* stream)
{
Connection *connection = storageConnection->connection;
- CycleLock cycleLock(table->database);
+ CycleLock cycleLock(connection->database);
table->update (connection->getTransaction(), oldRecord, stream);
return 0;
=== modified file 'storage/falcon/Table.cpp'
--- a/storage/falcon/Table.cpp 2009-03-27 04:29:33 +0000
+++ b/storage/falcon/Table.cpp 2009-03-28 06:05:52 +0000
@@ -3427,6 +3427,7 @@ void Table::waitForWriteComplete()
void Table::unlockRecord(int recordNumber, int verbMark)
{
+ CycleLock cycleLock(database);
Record *record = fetch(recordNumber);
if (record)
Attachment: [text/bzr-bundle] bzr/kevin.lewis@sun.com-20090328060552-7zyshkjz8n6nzkbe.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-falcon-team branch (kevin.lewis:3083) | Kevin Lewis | 28 Mar |