Commit 1cedcdd2 authored by unknown's avatar unknown

ndb - rbr blobs: fixes (not final)


storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  invalidate table=>invalidate blob tables
storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  invalidate table=>invalidate blob tables
storage/ndb/src/ndbapi/DictCache.cpp:
  DBUG_PRINT
sql/ha_ndbcluster.cc:
  avoid discovering NDB$BLOB tables
mysql-test/t/disabled.def:
  rpl_ndb_blob passes again
parent f9b94301
...@@ -43,6 +43,6 @@ rpl_sp : Bug#16456 ...@@ -43,6 +43,6 @@ rpl_sp : Bug#16456
rpl_until : Unstable test case, bug#15886 rpl_until : Unstable test case, bug#15886
sp-goto : GOTO is currently is disabled - will be fixed in the future sp-goto : GOTO is currently is disabled - will be fixed in the future
subselect : Bug#15706 (ps mode) [PATCH PENDING] subselect : Bug#15706 (ps mode) [PATCH PENDING]
rpl_ndb_blob : Bug #17505 #rpl_ndb_blob : Bug #17505
rpl_ndb_blob2 : Bug #17505 rpl_ndb_blob2 : Bug #17505
rpl_ndb_log : results are not deterministic rpl_ndb_log : results are not deterministic
...@@ -5525,7 +5525,7 @@ int ndbcluster_find_all_files(THD *thd) ...@@ -5525,7 +5525,7 @@ int ndbcluster_find_all_files(THD *thd)
{ {
NDBDICT::List::Element& elmt= list.elements[i]; NDBDICT::List::Element& elmt= list.elements[i];
int do_handle_table= 0; int do_handle_table= 0;
if (IS_TMP_PREFIX(elmt.name)) if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
{ {
DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name)); DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
continue; continue;
...@@ -5662,7 +5662,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path, ...@@ -5662,7 +5662,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
for (i= 0 ; i < list.count ; i++) for (i= 0 ; i < list.count ; i++)
{ {
NDBDICT::List::Element& elmt= list.elements[i]; NDBDICT::List::Element& elmt= list.elements[i];
if (IS_TMP_PREFIX(elmt.name)) if (IS_TMP_PREFIX(elmt.name) || IS_NDB_BLOB_PREFIX(elmt.name))
{ {
DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name)); DBUG_PRINT("info", ("Skipping %s.%s in NDB", elmt.database, elmt.name));
continue; continue;
......
...@@ -159,11 +159,16 @@ GlobalDictCache::get(const char * name) ...@@ -159,11 +159,16 @@ GlobalDictCache::get(const char * name)
switch(ver->m_status){ switch(ver->m_status){
case OK: case OK:
ver->m_refCount++; ver->m_refCount++;
DBUG_PRINT("info", ("Table OK version=%x.%x refCount=%u",
ver->m_impl->m_version & 0xFFFFFF,
ver->m_impl->m_version >> 24,
ver->m_refCount));
DBUG_RETURN(ver->m_impl); DBUG_RETURN(ver->m_impl);
case DROPPED: case DROPPED:
retreive = true; // Break loop retreive = true; // Break loop
break; break;
case RETREIVING: case RETREIVING:
DBUG_PRINT("info", ("Wait for retrieving thread"));
NdbCondition_WaitTimeout(m_waitForTableCondition, m_mutex, waitTime); NdbCondition_WaitTimeout(m_waitForTableCondition, m_mutex, waitTime);
continue; continue;
} }
...@@ -178,6 +183,7 @@ GlobalDictCache::get(const char * name) ...@@ -178,6 +183,7 @@ GlobalDictCache::get(const char * name)
tmp.m_status = RETREIVING; tmp.m_status = RETREIVING;
tmp.m_refCount = 1; // The one retreiving it tmp.m_refCount = 1; // The one retreiving it
versions->push_back(tmp); versions->push_back(tmp);
DBUG_PRINT("info", ("No table found"));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -185,8 +191,11 @@ NdbTableImpl * ...@@ -185,8 +191,11 @@ NdbTableImpl *
GlobalDictCache::put(const char * name, NdbTableImpl * tab) GlobalDictCache::put(const char * name, NdbTableImpl * tab)
{ {
DBUG_ENTER("GlobalDictCache::put"); DBUG_ENTER("GlobalDictCache::put");
DBUG_PRINT("enter", ("name: %s, internal_name: %s", DBUG_PRINT("enter", ("name: %s, internal_name: %s version: %x.%x",
name, tab ? tab->m_internalName.c_str() : "tab NULL")); name,
tab ? tab->m_internalName.c_str() : "tab NULL",
tab ? tab->m_version & 0xFFFFFF : 0,
tab ? tab->m_version >> 24 : 0));
const Uint32 len = strlen(name); const Uint32 len = strlen(name);
Vector<TableVersion> * vers = m_tableHash.getData(name, len); Vector<TableVersion> * vers = m_tableHash.getData(name, len);
...@@ -218,12 +227,14 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab) ...@@ -218,12 +227,14 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab)
vers->erase(sz - 1); vers->erase(sz - 1);
} }
else if (ver.m_impl == 0) { else if (ver.m_impl == 0) {
DBUG_PRINT("info", ("Table OK"));
ver.m_impl = tab; ver.m_impl = tab;
ver.m_version = tab->m_version; ver.m_version = tab->m_version;
ver.m_status = OK; ver.m_status = OK;
} }
else if (ver.m_impl == &f_invalid_table) else if (ver.m_impl == &f_invalid_table)
{ {
DBUG_PRINT("info", ("Table DROPPED invalid"));
ver.m_impl = tab; ver.m_impl = tab;
ver.m_version = tab->m_version; ver.m_version = tab->m_version;
ver.m_status = DROPPED; ver.m_status = DROPPED;
...@@ -231,6 +242,7 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab) ...@@ -231,6 +242,7 @@ GlobalDictCache::put(const char * name, NdbTableImpl * tab)
} }
else if(ver.m_impl == &f_altered_table) else if(ver.m_impl == &f_altered_table)
{ {
DBUG_PRINT("info", ("Table DROPPED altered"));
ver.m_impl = tab; ver.m_impl = tab;
ver.m_version = tab->m_version; ver.m_version = tab->m_version;
ver.m_status = DROPPED; ver.m_status = DROPPED;
......
...@@ -2767,16 +2767,28 @@ NdbDictInterface::execDROP_TABLE_REF(NdbApiSignal * signal, ...@@ -2767,16 +2767,28 @@ NdbDictInterface::execDROP_TABLE_REF(NdbApiSignal * signal,
} }
int int
NdbDictionaryImpl::invalidateObject(NdbTableImpl & impl) NdbDictionaryImpl::invalidateObject(NdbTableImpl & impl, bool lock)
{ {
const char * internalTableName = impl.m_internalName.c_str(); const char * internalTableName = impl.m_internalName.c_str();
DBUG_ENTER("NdbDictionaryImpl::invalidateObject"); DBUG_ENTER("NdbDictionaryImpl::invalidateObject");
DBUG_PRINT("enter", ("internal_name: %s", internalTableName)); DBUG_PRINT("enter", ("internal_name: %s", internalTableName));
if (lock)
m_globalHash->lock();
if (impl.m_noOfBlobs != 0) {
for (uint i = 0; i < impl.m_columns.size(); i++) {
NdbColumnImpl& c = *impl.m_columns[i];
if (! c.getBlobType() || c.getPartSize() == 0)
continue;
assert(c.m_blobTable != NULL);
invalidateObject(*c.m_blobTable, false);
}
}
m_localHash.drop(internalTableName); m_localHash.drop(internalTableName);
m_globalHash->lock();
impl.m_status = NdbDictionary::Object::Invalid; impl.m_status = NdbDictionary::Object::Invalid;
m_globalHash->drop(&impl); m_globalHash->drop(&impl);
m_globalHash->unlock(); if (lock)
m_globalHash->unlock();
DBUG_RETURN(0); DBUG_RETURN(0);
} }
...@@ -2784,6 +2796,8 @@ int ...@@ -2784,6 +2796,8 @@ int
NdbDictionaryImpl::removeCachedObject(NdbTableImpl & impl, bool lock) NdbDictionaryImpl::removeCachedObject(NdbTableImpl & impl, bool lock)
{ {
const char * internalTableName = impl.m_internalName.c_str(); const char * internalTableName = impl.m_internalName.c_str();
DBUG_ENTER("NdbDictionaryImpl::removeCachedObject");
DBUG_PRINT("enter", ("internal_name: %s", internalTableName));
if (lock) if (lock)
m_globalHash->lock(); m_globalHash->lock();
...@@ -2800,7 +2814,7 @@ NdbDictionaryImpl::removeCachedObject(NdbTableImpl & impl, bool lock) ...@@ -2800,7 +2814,7 @@ NdbDictionaryImpl::removeCachedObject(NdbTableImpl & impl, bool lock)
m_globalHash->release(&impl); m_globalHash->release(&impl);
if (lock) if (lock)
m_globalHash->unlock(); m_globalHash->unlock();
return 0; DBUG_RETURN(0);
} }
/***************************************************************** /*****************************************************************
......
...@@ -546,7 +546,7 @@ public: ...@@ -546,7 +546,7 @@ public:
int dropTable(const char * name); int dropTable(const char * name);
int dropTable(NdbTableImpl &); int dropTable(NdbTableImpl &);
int dropBlobTables(NdbTableImpl &); int dropBlobTables(NdbTableImpl &);
int invalidateObject(NdbTableImpl &); int invalidateObject(NdbTableImpl &, bool lock = true);
int removeCachedObject(NdbTableImpl &, bool lock = true); int removeCachedObject(NdbTableImpl &, bool lock = true);
int createIndex(NdbIndexImpl &ix); int createIndex(NdbIndexImpl &ix);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment