Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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
1.2207 06/03/23 22:49:02 tomas@stripped +5 -0
Bug #18472 race condition between multiple mysqld's when setting up cluster/schema
- check that event is the correct one, and only delete if wrong version
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
1.55 06/03/23 22:48:55 tomas@stripped +2 -0
Bug #18472 race condition between multiple mysqld's when setting up cluster/schema
- check that event is the correct one, and only delete if wrong version
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
1.117 06/03/23 22:48:55 tomas@stripped +17 -4
Bug #18472 race condition between multiple mysqld's when setting up cluster/schema
- check that event is the correct one, and only delete if wrong version
sql/ha_ndbcluster_binlog.h
1.10 06/03/23 22:48:55 tomas@stripped +2 -0
Bug #18472 race condition between multiple mysqld's when setting up cluster/schema
- check that event is the correct one, and only delete if wrong version
sql/ha_ndbcluster_binlog.cc
1.38 06/03/23 22:48:55 tomas@stripped +11 -1
Bug #18472 race condition between multiple mysqld's when setting up cluster/schema
- check that event is the correct one, and only delete if wrong version
sql/ha_ndbcluster.cc
1.289 06/03/23 22:48:55 tomas@stripped +0 -2
Bug #18472 race condition between multiple mysqld's when setting up cluster/schema
- check that event is the correct one, and only delete if wrong version
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-new
--- 1.116/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2006-03-20 16:03:28 +01:00
+++ 1.117/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp 2006-03-23 22:48:55 +01:00
@@ -3435,6 +3435,11 @@
// NdbEventImpl *evntImpl = (NdbEventImpl *)evntConf->getUserData();
+ evnt.m_eventId = evntConf->getEventId();
+ evnt.m_eventKey = evntConf->getEventKey();
+ evnt.m_table_id = evntConf->getTableId();
+ evnt.m_table_version = evntConf->getTableVersion();
+
if (getFlag) {
evnt.m_attrListBitmask = evntConf->getAttrListBitmask();
evnt.mi_type = evntConf->getEventType();
@@ -3449,9 +3454,6 @@
}
}
- evnt.m_eventId = evntConf->getEventId();
- evnt.m_eventKey = evntConf->getEventKey();
-
DBUG_RETURN(0);
}
@@ -3560,7 +3562,10 @@
delete ev;
DBUG_RETURN(NULL);
}
- if (info->m_table_impl->m_status != NdbDictionary::Object::Retrieved)
+ if ((info->m_table_impl->m_status != NdbDictionary::Object::Retrieved) ||
+ (info->m_table_impl->m_id != ev->m_table_id) ||
+ (table_version_major(info->m_table_impl->m_version) !=
+ table_version_major(ev->m_table_version)))
{
removeCachedObject(*info->m_table_impl);
info= get_local_table_info(ev->getTableName());
@@ -3584,6 +3589,14 @@
DBUG_PRINT("info",("Table: id: %d version: %d",
table.m_id, table.m_version));
+ if (table.m_id != ev->m_table_id ||
+ table_version_major(table.m_version) !=
+ table_version_major(ev->m_table_version))
+ {
+ m_error.code = 241;
+ delete ev;
+ DBUG_RETURN(NULL);
+ }
#ifndef DBUG_OFF
char buf[128] = {0};
mask.getText(buf);
--- 1.54/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2006-03-06 11:13:55 +01:00
+++ 1.55/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp 2006-03-23 22:48:55 +01:00
@@ -303,6 +303,8 @@
Uint32 m_eventId;
Uint32 m_eventKey;
AttributeMask m_attrListBitmask;
+ Uint32 m_table_id;
+ Uint32 m_table_version;
BaseString m_name;
Uint32 mi_type;
NdbDictionary::Event::EventDurability m_dur;
--- 1.288/sql/ha_ndbcluster.cc 2006-03-18 10:03:43 +01:00
+++ 1.289/sql/ha_ndbcluster.cc 2006-03-23 22:48:55 +01:00
@@ -101,8 +101,6 @@
#define NDB_FAILED_AUTO_INCREMENT ~(Uint64)0
#define NDB_AUTO_INCREMENT_RETRIES 10
-#define NDB_INVALID_SCHEMA_OBJECT 241
-
#define ERR_PRINT(err) \
DBUG_PRINT("error", ("%d message: %s", err.code, err.message))
--- 1.37/sql/ha_ndbcluster_binlog.cc 2006-03-21 16:54:45 +01:00
+++ 1.38/sql/ha_ndbcluster_binlog.cc 2006-03-23 22:48:55 +01:00
@@ -2193,9 +2193,19 @@
}
/*
+ try retrieving the event, if table version/id matches, we will get
+ a valid event. Otherwise we have a trailing event from before
+ */
+ if (dict->getEvent(event_name))
+ {
+ DBUG_RETURN(0);
+ }
+
+ /*
trailing event from before; an error, but try to correct it
*/
- if (dict->dropEvent(my_event.getName()))
+ if (dict->getNdbError().code == NDB_INVALID_SCHEMA_OBJECT &&
+ dict->dropEvent(my_event.getName()))
{
if (push_warning)
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
--- 1.9/sql/ha_ndbcluster_binlog.h 2006-03-01 18:22:54 +01:00
+++ 1.10/sql/ha_ndbcluster_binlog.h 2006-03-23 22:48:55 +01:00
@@ -29,6 +29,8 @@
#define INJECTOR_EVENT_LEN 200
+#define NDB_INVALID_SCHEMA_OBJECT 241
+
/*
The numbers below must not change as they
are passed between mysql servers, and if changed
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2207) BUG#18472 | tomas | 23 Mar |