mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Better handling of transaction ids,
make *sure* that no one gets same transid twice (wo/ restarting process)
This commit is contained in:
@@ -682,7 +682,7 @@ NdbDictInterface::~NdbDictInterface()
|
||||
{
|
||||
if (m_transporter != NULL){
|
||||
if (m_blockNumber != -1)
|
||||
m_transporter->close(m_blockNumber);
|
||||
m_transporter->close(m_blockNumber, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ Ndb::init(int aMaxNoOfTransactions)
|
||||
}
|
||||
|
||||
theFirstTransId = ((Uint64)theNdbBlockNumber << 52)+((Uint64)theNode << 40);
|
||||
theFirstTransId += theFacade->m_open_count;
|
||||
theFirstTransId += theFacade->m_max_trans_id;
|
||||
theFacade->unlock_mutex();
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ error_handler:
|
||||
freeOperation();
|
||||
|
||||
delete theDictionary;
|
||||
TransporterFacade::instance()->close(theNdbBlockNumber);
|
||||
TransporterFacade::instance()->close(theNdbBlockNumber, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@@ -195,7 +195,7 @@ Ndb::~Ndb()
|
||||
NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle);
|
||||
|
||||
if (TransporterFacade::instance() != NULL && theNdbBlockNumber > 0){
|
||||
TransporterFacade::instance()->close(theNdbBlockNumber);
|
||||
TransporterFacade::instance()->close(theNdbBlockNumber, theFirstTransId);
|
||||
}
|
||||
|
||||
NdbMutex_Lock(&createNdbMutex);
|
||||
|
@@ -548,7 +548,7 @@ TransporterFacade::TransporterFacade() :
|
||||
theClusterMgr = NULL;
|
||||
theArbitMgr = NULL;
|
||||
theStartNodeId = 1;
|
||||
m_open_count = 0;
|
||||
m_max_trans_id = 0;
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -684,9 +684,11 @@ TransporterFacade::ReportNodeAlive(NodeId tNodeId)
|
||||
}
|
||||
|
||||
int
|
||||
TransporterFacade::close(BlockNumber blockNumber)
|
||||
TransporterFacade::close(BlockNumber blockNumber, Uint64 trans_id)
|
||||
{
|
||||
NdbMutex_Lock(theMutexPtr);
|
||||
Uint32 low_bits = (Uint32)trans_id;
|
||||
m_max_trans_id = m_max_trans_id > low_bits ? m_max_trans_id : low_bits;
|
||||
close_local(blockNumber);
|
||||
NdbMutex_Unlock(theMutexPtr);
|
||||
return 0;
|
||||
@@ -703,7 +705,6 @@ TransporterFacade::open(void* objRef,
|
||||
ExecuteFunction fun,
|
||||
NodeStatusFunction statusFun)
|
||||
{
|
||||
m_open_count++;
|
||||
return m_threads.open(objRef, fun, statusFun);
|
||||
}
|
||||
|
||||
|
@@ -67,7 +67,7 @@ public:
|
||||
int open(void* objRef, ExecuteFunction, NodeStatusFunction);
|
||||
|
||||
// Close this block number
|
||||
int close(BlockNumber blockNumber);
|
||||
int close(BlockNumber blockNumber, Uint64 trans_id);
|
||||
|
||||
// Only sends to nodes which are alive
|
||||
int sendSignal(NdbApiSignal * signal, NodeId nodeId);
|
||||
@@ -211,7 +211,7 @@ private:
|
||||
}
|
||||
} m_threads;
|
||||
|
||||
Uint32 m_open_count;
|
||||
Uint32 m_max_trans_id;
|
||||
|
||||
/**
|
||||
* execute function
|
||||
|
Reference in New Issue
Block a user