mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 11:56:31 +00:00
This reverts commit f916e64927
.
This commit is contained in:
@ -26,8 +26,7 @@
|
||||
#include <ctime>
|
||||
|
||||
//#define SERIALIZE_DDL_DML_CPIMPORT 1
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
@ -61,8 +60,8 @@ using namespace WriteEngine;
|
||||
#include "querytele.h"
|
||||
using namespace querytele;
|
||||
|
||||
extern std::mutex mute;
|
||||
extern std::condition_variable cond;
|
||||
extern boost::mutex mute;
|
||||
extern boost::condition_variable cond;
|
||||
|
||||
#define MCOL_140 // Undefine to test VSS for out of order transactions
|
||||
|
||||
@ -76,16 +75,16 @@ namespace dmlprocessor
|
||||
// Map to store the package handler objects so we can set flags during execution
|
||||
// for things like ctrl+c
|
||||
DMLProcessor::PackageHandlerMap_t DMLProcessor::packageHandlerMap;
|
||||
std::mutex DMLProcessor::packageHandlerMapLock;
|
||||
boost::mutex DMLProcessor::packageHandlerMapLock;
|
||||
|
||||
// Map to store the BatchInsertProc object
|
||||
std::map<uint32_t, BatchInsertProc*> DMLProcessor::batchinsertProcessorMap;
|
||||
std::mutex DMLProcessor::batchinsertProcessorMapLock;
|
||||
boost::mutex DMLProcessor::batchinsertProcessorMapLock;
|
||||
|
||||
// MCOL-140 Map to hold table oids for tables being changed.
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t> PackageHandler::tableOidMap;
|
||||
std::condition_variable PackageHandler::tableOidCond;
|
||||
std::mutex PackageHandler::tableOidMutex;
|
||||
boost::condition_variable PackageHandler::tableOidCond;
|
||||
boost::mutex PackageHandler::tableOidMutex;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// A thread to periodically call dbrm to see if a user is
|
||||
@ -146,7 +145,7 @@ struct CancellationThread
|
||||
// Tell any active processors to stop working and return an error
|
||||
// The front end will respond with a ROLLBACK command.
|
||||
// Mark all active processors to rollback
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
|
||||
for (phIter = DMLProcessor::packageHandlerMap.begin();
|
||||
phIter != DMLProcessor::packageHandlerMap.end(); ++phIter)
|
||||
@ -366,7 +365,7 @@ int PackageHandler::synchTableAccess(dmlpackage::CalpontDMLPackage* dmlPackage)
|
||||
{
|
||||
// MCOL-140 Wait for any other DML using this table.
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t>::iterator it;
|
||||
std::unique_lock<std::mutex> lock(tableOidMutex);
|
||||
boost::unique_lock<boost::mutex> lock(tableOidMutex);
|
||||
BRM::TxnID txnid;
|
||||
|
||||
if (fPackageType != dmlpackage::DML_COMMAND)
|
||||
@ -466,7 +465,7 @@ int PackageHandler::releaseTableAccess()
|
||||
{
|
||||
// take us out of the queue
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t>::iterator it;
|
||||
boost::lock_guard<std::mutex> lock(tableOidMutex);
|
||||
boost::lock_guard<boost::mutex> lock(tableOidMutex);
|
||||
|
||||
if (fTableOid == 0 || (it = tableOidMap.find(fTableOid)) == tableOidMap.end())
|
||||
{
|
||||
@ -513,7 +512,7 @@ int PackageHandler::forceReleaseTableAccess()
|
||||
// By removing the txnid from the queue, the logic after the wait in
|
||||
// synchTableAccess() will release the thread and clean up if needed.
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t>::iterator it;
|
||||
boost::lock_guard<std::mutex> lock(tableOidMutex);
|
||||
boost::lock_guard<boost::mutex> lock(tableOidMutex);
|
||||
|
||||
if (fTableOid == 0 || (it = tableOidMap.find(fTableOid)) == tableOidMap.end())
|
||||
{
|
||||
@ -604,7 +603,7 @@ void PackageHandler::run()
|
||||
// cout << "This is batch insert " << endl;
|
||||
BatchInsertProc* batchProcessor = NULL;
|
||||
{
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
@ -751,7 +750,7 @@ void PackageHandler::run()
|
||||
|
||||
// remove the batch insert object
|
||||
{
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
@ -867,7 +866,7 @@ void PackageHandler::run()
|
||||
|
||||
// remove from map
|
||||
{
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
|
||||
@ -912,7 +911,7 @@ void PackageHandler::run()
|
||||
logger.logMessage(LOG_TYPE_DEBUG, msg, logid);
|
||||
// remove from map
|
||||
{
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
|
||||
@ -1164,7 +1163,7 @@ void PackageHandler::run()
|
||||
// If we remove it after sending the results, it's possible for a commit
|
||||
// or rollback be sent and get processed before it is removed, and that
|
||||
// will fail.
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
DMLProcessor::packageHandlerMap.erase(getSessionID());
|
||||
lk2.unlock();
|
||||
|
||||
@ -1453,7 +1452,7 @@ void DMLProcessor::operator()()
|
||||
if (insertPkg.get_isBatchInsert() && insertPkg.get_Logending())
|
||||
{
|
||||
{
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(sessionID);
|
||||
|
||||
@ -1503,7 +1502,7 @@ void DMLProcessor::operator()()
|
||||
// This mechanism may prove useful for other things, so the above
|
||||
// comment may change.
|
||||
{
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
DMLProcessor::PackageHandlerMap_t::iterator phIter = packageHandlerMap.find(sessionID);
|
||||
|
||||
if (phIter != packageHandlerMap.end())
|
||||
@ -1741,7 +1740,7 @@ void DMLProcessor::operator()()
|
||||
sessionID, txnid.id, fDbrm, fQtc, csc));
|
||||
// We put the packageHandler into a map so that if we receive a
|
||||
// message to affect the previous command, we can find it.
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock, std::defer_lock);
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock, boost::defer_lock);
|
||||
|
||||
lk2.lock();
|
||||
packageHandlerMap[sessionID] = php;
|
||||
@ -1783,7 +1782,7 @@ void DMLProcessor::operator()()
|
||||
fIos, bs1, packageType, fEC, fConcurrentSupport, maxDeleteRows, sessionID, 0, fDbrm, fQtc, csc));
|
||||
// We put the packageHandler into a map so that if we receive a
|
||||
// message to affect the previous command, we can find it.
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock, std::defer_lock);
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock, boost::defer_lock);
|
||||
|
||||
lk2.lock();
|
||||
packageHandlerMap[sessionID] = php;
|
||||
|
Reference in New Issue
Block a user