summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-02-24 18:58:56 +0100
committerunknown <joreland@mysql.com>2005-02-24 18:58:56 +0100
commit6b38100d6146cae344aaf90d77c0f4475ea30bb8 (patch)
treec42c76037072fb14de1439b127b5c4c5bde8b8fb /ndb/src/ndbapi
parentbf88db5c2036f6194d710a3a2faca7ab6fb4a77b (diff)
downloadmariadb-git-6b38100d6146cae344aaf90d77c0f4475ea30bb8.tar.gz
bug#8786 - ndb autodiscover, sometimes fails
remove dict forwarding add api retries on NotMaster ndb/include/kernel/signaldata/AlterIndx.hpp: Add NotMaster error code ndb/include/kernel/signaldata/BuildIndx.hpp: Add NotMaster error code ndb/include/kernel/signaldata/CreateIndx.hpp: Add NotMaster error code ndb/include/kernel/signaldata/CreateTrig.hpp: Add NotMaster error code ndb/include/kernel/signaldata/DropIndx.hpp: Add NotMaster error code ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Never forward requests, instead REF to API who will retry towards correct node ndb/src/ndbapi/NdbDictionaryImpl.cpp: 1) Set error code for timeout 2) Handle NotMaster with retry in all DICT requests ndb/src/ndbapi/ndb_cluster_connection.cpp: Fix so that input values is in seconds and not 100ms's sql/ha_ndbcluster.cc: Wait 3 sec for all nodes to connect...
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp18
-rw-r--r--ndb/src/ndbapi/ndb_cluster_connection.cpp3
2 files changed, 16 insertions, 5 deletions
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 9f6ed144fb0..3d92f0e010f 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -945,6 +945,12 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal,
if(m_waiter.m_state == WAIT_NODE_FAILURE)
continue;
+ if(m_waiter.m_state == WST_WAIT_TIMEOUT)
+ {
+ m_error.code = 4008;
+ DBUG_RETURN(-1);
+ }
+
if ( (temporaryMask & m_error.code) != 0 ) {
continue;
}
@@ -2091,8 +2097,8 @@ int
NdbDictInterface::createIndex(NdbApiSignal* signal,
LinearSectionPtr ptr[3])
{
- const int noErrCodes = 1;
- int errCodes[noErrCodes] = {CreateIndxRef::Busy};
+ const int noErrCodes = 2;
+ int errCodes[noErrCodes] = {CreateIndxRef::Busy, CreateIndxRef::NotMaster};
return dictSignal(signal,ptr,2,
1 /*use masternode id*/,
100,
@@ -2116,6 +2122,8 @@ NdbDictInterface::execCREATE_INDX_REF(NdbApiSignal * signal,
{
const CreateIndxRef* const ref = CAST_CONSTPTR(CreateIndxRef, signal->getDataPtr());
m_error.code = ref->getErrorCode();
+ if(m_error.code == ref->NotMaster)
+ m_masterNodeId= ref->m_errorNode;
m_waiter.signal(NO_WAIT);
}
@@ -2212,8 +2220,8 @@ NdbDictInterface::dropIndex(const NdbIndexImpl & impl,
int
NdbDictInterface::dropIndex(NdbApiSignal* signal, LinearSectionPtr ptr[3])
{
- const int noErrCodes = 1;
- int errCodes[noErrCodes] = {DropIndxRef::Busy};
+ const int noErrCodes = 2;
+ int errCodes[noErrCodes] = {DropIndxRef::Busy, DropIndxRef::NotMaster};
int r = dictSignal(signal,NULL,0,
1/*Use masternode id*/,
100,
@@ -2240,6 +2248,8 @@ NdbDictInterface::execDROP_INDX_REF(NdbApiSignal * signal,
{
const DropIndxRef* const ref = CAST_CONSTPTR(DropIndxRef, signal->getDataPtr());
m_error.code = ref->getErrorCode();
+ if(m_error.code == ref->NotMaster)
+ m_masterNodeId= ref->m_errorNode;
m_waiter.signal(NO_WAIT);
}
diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp
index 5df707e211d..4650a719542 100644
--- a/ndb/src/ndbapi/ndb_cluster_connection.cpp
+++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp
@@ -222,7 +222,8 @@ Ndb_cluster_connection::wait_until_ready(int timeout,
else if (foundAliveNode > 0)
{
noChecksSinceFirstAliveFound++;
- if (noChecksSinceFirstAliveFound > timeout_after_first_alive)
+ // 100 ms delay -> 10*
+ if (noChecksSinceFirstAliveFound > 10*timeout_after_first_alive)
DBUG_RETURN(1);
}
else if (secondsCounter >= timeout)