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, 2007-10-01 11:30:50-04:00, jas@rowvwade. +2 -0
Eliminate Table::syncUpdate lock to avoid deadlocks. This
leaves the parallel duplicate insert bug in place.
storage/falcon/Table.cpp@stripped, 2007-10-01 11:30:41-04:00, jas@rowvwade. +7 -14
Eliminate Table::syncUpdate lock to avoid deadlocks. This
leaves the parallel duplicate insert bug in place.
storage/falcon/Table.h@stripped, 2007-10-01 11:30:41-04:00, jas@rowvwade. +0 -1
Eliminate Table::syncUpdate lock to avoid deadlocks. This
leaves the parallel duplicate insert bug in place.
diff -Nrup a/storage/falcon/Table.cpp b/storage/falcon/Table.cpp
--- a/storage/falcon/Table.cpp 2007-09-25 01:14:42 -04:00
+++ b/storage/falcon/Table.cpp 2007-10-01 11:30:41 -04:00
@@ -332,11 +332,9 @@ void Table::insert(Transaction *transact
// Verify that record is valid
checkNullable(record);
- Sync sync(&syncUpdate, "Table::insert");
if (indexes)
{
- sync.lock(Exclusive);
checkUniqueIndexes(transaction, record);
}
@@ -1072,11 +1070,8 @@ void Table::update(Transaction * transac
// Make sure no uniqueness rules are violated
- Sync sync(&syncUpdate, "Table::update");
-
if (indexes)
{
- sync.lock(Exclusive);
checkUniqueIndexes(transaction, record);
}
@@ -2169,7 +2164,7 @@ void Table::checkUniqueIndexes(Transacti
FOR_INDEXES(index, this);
if ((index->type == UniqueIndex || index->type == PrimaryKey) &&
- (!oldRecord || index->changed(record, oldRecord)))
+ (!oldRecord || index->changed(record, oldRecord)))
{
IndexKey indexKey(index);
index->makeKey(record, &indexKey);
@@ -2240,6 +2235,7 @@ void Table::checkUniqueIndexes(Transacti
// wait for that transaction to finish, then check again
state = transaction->getRelativeState(dup, WAIT_IF_ACTIVE);
+
if (state != Deadlock)
{
state = WasActive; // Stay in the do loop. state will be rechecked.
@@ -2251,7 +2247,7 @@ void Table::checkUniqueIndexes(Transacti
if (activeTransaction)
{
state = transaction->getRelativeState(activeTransaction,
- activeTransaction->transactionId, WAIT_IF_ACTIVE);
+ activeTransaction->transactionId, WAIT_IF_ACTIVE);
state = WasActive; // Stay in the do loop. state will be rechecked.
rec->release();
activeTransaction->release();
@@ -2263,7 +2259,7 @@ void Table::checkUniqueIndexes(Transacti
if (strcmp(schemaName, "SYSTEM") == 0)
printf("Duplicate %s.%s\n", name, schemaName);
- // isDuplicate(index, record, dup);
+ // isDuplicate(index, record, dup); // uncomment to debug
rec->release();
const char *text = "duplicate values for key %s in table %s.%s";
int code = UNIQUE_DUPLICATE;
@@ -2323,6 +2319,7 @@ void Table::checkUniqueIndexes(Transacti
if (rec)
rec->release();
+
if (activeTransaction)
{
activeTransaction->release();
@@ -2636,11 +2633,9 @@ uint Table::insert(Transaction *transact
record = allocRecordVersion(fmt, transaction, NULL);
record->setEncodedRecord(stream, false);
- Sync sync(&syncUpdate, "Table::insert");
if (indexes)
{
- sync.lock(Exclusive);
checkUniqueIndexes(transaction, record);
}
@@ -2754,11 +2749,8 @@ void Table::update(Transaction * transac
// Make sure no uniqueness rules are violated
- Sync sync(&syncUpdate, "Table::update");
-
if (indexes)
{
- sync.lock(Exclusive);
checkUniqueIndexes(transaction, record);
}
@@ -2793,8 +2785,10 @@ void Table::update(Transaction * transac
// carefully remove the prior version.
record->scavenge(transaction->transactionId, transaction->curSavePointId);
+
if (record)
record->release();
+
oldRecord->release(); // This reference originated in this function.
}
catch (...)
@@ -2826,7 +2820,6 @@ void Table::update(Transaction * transac
void Table::rename(const char *newSchema, const char *newName)
{
-
for (const char **tbl = relatedTables; *tbl; ++tbl)
{
char sql [512];
diff -Nrup a/storage/falcon/Table.h b/storage/falcon/Table.h
--- a/storage/falcon/Table.h 2007-09-25 01:14:42 -04:00
+++ b/storage/falcon/Table.h 2007-10-01 11:30:41 -04:00
@@ -202,7 +202,6 @@ public:
SyncObject syncObject;
SyncObject syncTriggers;
SyncObject syncScavenge;
- SyncObject syncUpdate;
SyncObject syncAlter; // prevent concurrent Alter statements.
Table *collision; // Hash collision in database
Table *idCollision; // mod(id) collision in database
| Thread |
|---|
| • bk commit into 6.0 tree (jas:1.2608) | U-ROWVWADEjas | 1 Oct |