mirror of
https://github.com/MariaDB/server.git
synced 2026-04-30 20:25:32 +02:00
Added random sleeps before retrying temporarly failed DICT signals, to avoid race conditions
This commit is contained in:
parent
b8c52ae394
commit
cfca20b052
1 changed files with 18 additions and 1 deletions
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue