diff options
author | unknown <mskold/marty@mysql.com/quadfish.(none)> | 2008-02-06 15:08:45 +0100 |
---|---|---|
committer | unknown <mskold/marty@mysql.com/quadfish.(none)> | 2008-02-06 15:08:45 +0100 |
commit | cfca20b052db619a6758532a47c2eaf33a6aea46 (patch) | |
tree | e6cf20f63e2a8c25ff5ec9880e6a52bb28f1d61d /ndb | |
parent | b8c52ae394fb3ebdd193f13492b8a8249fdd0ede (diff) | |
download | mariadb-git-cfca20b052db619a6758532a47c2eaf33a6aea46.tar.gz |
Added random sleeps before retrying temporarly failed DICT signals, to avoid race conditions
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/ndbapi/NdbDictionaryImpl.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index bf0c02714db..ecbf527c9ae 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -35,6 +35,7 @@ #include "NdbBlobImpl.hpp" #include <AttributeHeader.hpp> #include <my_sys.h> +#include <NdbSleep.h> #define DEBUG_PRINT 0 #define INCOMPATIBLE_VERSION -2 @@ -886,7 +887,23 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, { DBUG_ENTER("NdbDictInterface::dictSignal"); DBUG_PRINT("enter", ("useMasterNodeId: %d", useMasterNodeId)); - for(Uint32 i = 0; i<RETRIES; i++){ + + int sleep = 50; + int mod = 5; + + for(Uint32 i = 0; i<RETRIES; i++) + { + if (i > 0) + NdbSleep_MilliSleep(sleep + 10 * (rand() % mod)); + if (i == RETRIES / 2) + { + mod = 10; + } + if (i == 3*RETRIES/4) + { + sleep = 100; + } + //if (useMasterNodeId == 0) m_buffer.clear(); |