Commit c3bde022 authored by Christian Mohrbacher's avatar Christian Mohrbacher

updated to release 6.5

parent 543268ec
......@@ -9,11 +9,13 @@ Before building BeeGFS, install the following dependency packages:
* Depedencies for RPM packages (Red Hat):
libuuid-devel libibverbs-devel librdmacm-devel libattr-devel redhat-rpm-config
rpm-build xfsprogs-devel cppunit cppunit-devel zlib-devel openssl-devel sqlite
sqlite-devel ant gcc-c++ gcc redhat-lsb-core java-devel
* Dependencies for DEB packages (Debian):
gcc g++ autoconf automake devscripts debhelper libtool libattr1-dev
xfslibs-dev lsb-release module-init-tools librdmacm-dev libibverbs-dev
openjdk-7-jdk ant dh-systemd libcppunit-dev zlib1g-dev libssl-dev sqlite
default-jdk ant dh-systemd libcppunit-dev zlib1g-dev libssl-dev sqlite3
libsqlite3-dev
Building all packages together
......
......@@ -52,7 +52,7 @@ sysMountSanityCheckMS = 11000
sysSessionCheckOnClose = false
sysSyncOnClose = false
sysTargetOfflineTimeoutSecs = 900
sysUpdateTargetStatesSecs = 60
sysUpdateTargetStatesSecs = 30
sysXAttrsEnabled = false
tuneFileCacheType = buffered
......@@ -318,12 +318,10 @@ sysACLsEnabled = false
# [sysUpdateTargetStatesSecs]
# Interval in which the states of the storage targets are checked.
# Note: Should be no higher than twice the sysUpdateTargetStatesSecs value set
# in the server config files.
# Note: This must be significantly shorter than the sysTargetOfflineTimeoutSecs
# value set in the server (recommendation: maximum 1/3 of it).
# Values: time in seconds
# Default: 60
# Default: 30
# [sysXAttrsEnabled]
# Enable extended attributes (also know as EAs/xattrs).
......
......@@ -220,7 +220,7 @@ void _Config_loadDefaults(Config* this)
_Config_configMapRedefine(this, "sysSyncOnClose", "false");
_Config_configMapRedefine(this, "sysSessionCheckOnClose", "false");
_Config_configMapRedefine(this, "sysUpdateTargetStatesSecs", "60");
_Config_configMapRedefine(this, "sysUpdateTargetStatesSecs", "30");
_Config_configMapRedefine(this, "sysTargetOfflineTimeoutSecs", "900");
// Note: The default here is intentionally set to double the value from the server config.
// This ensures that the servers push their state twice during one Mgmtd InternodeSyncer run,
......
......@@ -12,7 +12,7 @@ typedef std::map<uint16_t, std::shared_ptr<Mutex>> MutexMap;
*
* @param mgmtNode the management node, need to be referenced
* @param storageNodes a NodeStore with all storage servers
* @param workQ the MultiWorkQueue of the app
* @param workQ the MultiWorkQueue to use
* @param outQuotaResults returns the quota informations
* @param mapper the target mapper (only required for GETQUOTACONFIG_SINGLE_TARGET and
* GETQUOTACONFIG_ALL_TARGETS_ONE_REQUEST_PER_TARGET)
......
......@@ -101,7 +101,7 @@ void InternodeSyncer::run()
void InternodeSyncer::syncLoop()
{
const int sleepIntervalMS = 3*1000; // 3sec
const unsigned downloadNodesAndStatesIntervalMS = 30000; // 30 sec // 5min
const unsigned downloadNodesAndStatesIntervalMS = 30000; // 30 sec
Time lastDownloadNodesAndStatesT;
......
......@@ -36,8 +36,8 @@ InternodeSyncer::InternodeSyncer(TargetConsistencyState initialConsistencyState)
MirrorBuddyGroupMapper* mbg = Program::getApp()->getMetaBuddyGroupMapper();
MirrorBuddyState buddyState = mbg->getBuddyState(Program::getApp()->getLocalNodeNumID().val() );
if ( (buddyState == BuddyState_PRIMARY)
&& (this->nodeConsistencyState == TargetConsistencyState_NEEDS_RESYNC) )
if ((buddyState == BuddyState_PRIMARY)
&& (nodeConsistencyState == TargetConsistencyState_NEEDS_RESYNC))
offlineWait.startTimer();
}
......@@ -65,13 +65,13 @@ void InternodeSyncer::syncLoop()
const int sleepIntervalMS = 3*1000; // 3sec
// If (undocumented) sysUpdateTargetStatesSecs is set in config, use that value, otherwise
// default to 1/3 sysTargetOfflineTimeoutSecs.
// default to 1/6 sysTargetOfflineTimeoutSecs.
const unsigned updateTargetStatesMS =
(cfg->getSysUpdateTargetStatesSecs() != 0)
? cfg->getSysUpdateTargetStatesSecs() * 1000
: cfg->getSysTargetOfflineTimeoutSecs() * 333;
: cfg->getSysTargetOfflineTimeoutSecs() * 166;
const unsigned updateCapacityPoolsMS = 2 * updateTargetStatesMS;
const unsigned updateCapacityPoolsMS = 4 * updateTargetStatesMS;
const unsigned metaCacheSweepNormalMS = 5*1000; // 5sec
const unsigned metaCacheSweepStressedMS = 2*1000; // 2sec
......@@ -145,11 +145,13 @@ void InternodeSyncer::syncLoop()
{
// if we're waiting to be offlined, set our local state to needs-resync and don't report
// anything to the mgmtd
this->nodeConsistencyState = TargetConsistencyState_NEEDS_RESYNC;
setNodeConsistencyState(TargetConsistencyState_NEEDS_RESYNC);
}
else
{
updateMetaStatesAndBuddyGroups(this->nodeConsistencyState, true);
TargetConsistencyState newConsistencyState;
updateMetaStatesAndBuddyGroups(newConsistencyState, true);
setNodeConsistencyState(newConsistencyState);
downloadAndSyncTargetStatesAndBuddyGroups();
}
......@@ -800,14 +802,14 @@ TargetConsistencyState InternodeSyncer::decideResync(const CombinedTargetState n
// If the consistency state is BAD, it stays BAD until admin intervenes.
if (internodeSyncer && // during early startup, INS is not constructed yet.
internodeSyncer->nodeConsistencyState == TargetConsistencyState_BAD)
internodeSyncer->getNodeConsistencyState() == TargetConsistencyState_BAD)
return TargetConsistencyState_BAD;
const bool isResyncing = newState.consistencyState == TargetConsistencyState_NEEDS_RESYNC;
const bool isBad = newState.consistencyState == TargetConsistencyState_BAD;
if (internodeSyncer &&
internodeSyncer->nodeConsistencyState == TargetConsistencyState_NEEDS_RESYNC)
internodeSyncer->getNodeConsistencyState() == TargetConsistencyState_NEEDS_RESYNC)
{
// If we're already (locally) maked as needs resync, this state can only be left when our
// (primary) buddy tells us the resync is finished.
......@@ -915,7 +917,7 @@ void InternodeSyncer::publishNodeCapacity()
getStatInfo(&sizeTotal, &sizeFree, &inodesTotal, &inodesFree);
StorageTargetInfo targetInfo(app->getLocalNodeNumID().val(), metaPath, sizeTotal, sizeFree,
inodesTotal, inodesFree, nodeConsistencyState);
inodesTotal, inodesFree, getNodeConsistencyState());
// Note: As long as we don't have meta-HA, consistency state will always be GOOD.
StorageTargetInfoList targetInfoList(1, targetInfo);
......
......@@ -50,6 +50,7 @@ class InternodeSyncer : public PThread
// waiting to be offlined by the mgmtd.
NodeOfflineWait offlineWait;
Mutex nodeConsistencyStateMutex;
TargetConsistencyState nodeConsistencyState; // Node's own consistency state.
// Note: This is initialized when updateMetaStates... is called from App::downloadMgmtInfo.
AtomicUInt32 buddyResyncInProgress;
......@@ -99,12 +100,14 @@ class InternodeSyncer : public PThread
TargetConsistencyState getNodeConsistencyState()
{
return this->nodeConsistencyState;
std::lock_guard<Mutex> lock(nodeConsistencyStateMutex);
return nodeConsistencyState;
}
void setNodeConsistencyState(TargetConsistencyState newState)
{
this->nodeConsistencyState = newState;
std::lock_guard<Mutex> lock(nodeConsistencyStateMutex);
nodeConsistencyState = newState;
}
void setResyncInProgress(bool resyncInProgress)
......
......@@ -175,40 +175,28 @@ FhgfsOpsErr MsgHelperXAttr::setxattr(EntryInfo* entryInfo, const std::string& na
return result;
}
FhgfsOpsErr MsgHelperXAttr::StreamXAttrState::loadNextXAttr(std::string& name, CharVector& value)
FhgfsOpsErr MsgHelperXAttr::StreamXAttrState::streamXattrFn(Socket* socket, void* context)
{
if (names.empty())
return FhgfsOpsErr_SUCCESS;
name.swap(names.back());
names.pop_back();
FhgfsOpsErr retVal;
if (entryInfo)
std::tie(retVal, value, std::ignore) = getxattr(entryInfo, name, XATTR_SIZE_MAX);
else
std::tie(retVal, value, std::ignore) = XAttrTk::getUserXAttr(path, name, XATTR_SIZE_MAX);
if (retVal == FhgfsOpsErr_SUCCESS)
retVal = FhgfsOpsErr_AGAIN;
StreamXAttrState* state = static_cast<StreamXAttrState*>(context);
return retVal;
return state->streamXattr(socket);
}
FhgfsOpsErr MsgHelperXAttr::StreamXAttrState::streamXattrFn(Socket* socket, void* context)
FhgfsOpsErr MsgHelperXAttr::StreamXAttrState::streamXattr(Socket* socket) const
{
StreamXAttrState* state = static_cast<StreamXAttrState*>(context);
for (auto xattr = names.cbegin(); xattr != names.cend(); ++xattr)
{
const auto& name = *xattr;
std::string name;
CharVector value;
CharVector value;
FhgfsOpsErr getRes;
while (true)
{
FhgfsOpsErr getRes = state->loadNextXAttr(name, value);
if (getRes == FhgfsOpsErr_SUCCESS)
break;
else if (getRes != FhgfsOpsErr_AGAIN)
if (entryInfo)
std::tie(getRes, value, std::ignore) = getxattr(entryInfo, name, XATTR_SIZE_MAX);
else
std::tie(getRes, value, std::ignore) = XAttrTk::getUserXAttr(path, name, XATTR_SIZE_MAX);
if (getRes != FhgfsOpsErr_SUCCESS)
{
uint32_t endMark = HOST_TO_LE_32(-1);
socket->send(&endMark, sizeof(endMark), 0);
......
......@@ -34,7 +34,6 @@ class MsgHelperXAttr
entryInfo(nullptr), path(std::move(path)), names(std::move(names))
{}
FhgfsOpsErr loadNextXAttr(std::string& name, CharVector& value);
static FhgfsOpsErr streamXattrFn(Socket* socket, void* context);
static FhgfsOpsErr readNextXAttr(Socket* socket, std::string& name, CharVector& value);
......@@ -43,6 +42,8 @@ class MsgHelperXAttr
EntryInfo* entryInfo;
std::string path;
StringVector names;
FhgfsOpsErr streamXattr(Socket* socket) const;
};
};
......
......@@ -705,7 +705,7 @@ bool FileInode::loadFromFileContents(const std::string& id, bool isBuddyMirrored
const char* logContext = "File inode (load from file)";
App* app = Program::getApp();
const Path* inodePath = isBuddyMirrored ? app->getInodesPath() : app->getBuddyMirrorInodesPath();
const Path* inodePath = isBuddyMirrored ? app->getBuddyMirrorInodesPath() : app->getInodesPath();
std::string metaFilename = MetaStorageTk::getMetaInodePath(inodePath->str(), id);
bool retVal = false;
......
......@@ -306,6 +306,10 @@ quotaEnableEnforcement = false
# critical for file system performance.
# Default: 4
# [tuneNumQuotaWorkers]
# The number of worker threads used for retrieval of quota information from storage servers.
# Default: 8
# [tune{Meta,Storage}DynamicPools]
# Temporarily raise the Low/Emergency limits if the spread (difference in free
# capacity between the targets with the most and the least free space) becomes
......
......@@ -37,6 +37,7 @@ void Config::loadDefaults(bool addDashes)
configMapRedefine("storeAllowFirstRunInit", "true");
configMapRedefine("tuneNumWorkers", "4");
configMapRedefine("tuneNumQuotaWorkers", "8");
configMapRedefine("tuneMetaNodeAutoRemoveMins", "0"); // ignored, only for compat
configMapRedefine("tuneStorageNodeAutoRemoveMins", "0"); // ignored, only for compat
configMapRedefine("tuneClientAutoRemoveMins", "60");
......@@ -134,6 +135,9 @@ void Config::applyConfigMap(bool enableException, bool addDashes) throw(InvalidC
if(iter->first == std::string("tuneNumWorkers") )
tuneNumWorkers = StringTk::strToUInt(iter->second);
else
if(iter->first == std::string("tuneNumQuotaWorkers") )
tuneNumQuotaWorkers = StringTk::strToUInt(iter->second);
else
if(iter->first == std::string("tuneMetaNodeAutoRemoveMins") )
tuneMetaNodeAutoRemoveMins = StringTk::strToUInt(iter->second);
else
......
......@@ -57,6 +57,7 @@ class Config : public AbstractConfig
bool storeAllowFirstRunInit;
unsigned tuneNumWorkers;
unsigned tuneNumQuotaWorkers;
unsigned tuneMetaNodeAutoRemoveMins; // ignored! (only for compatibility with old cfg file)
unsigned tuneStorageNodeAutoRemoveMins; // ignored! (only for compat with old cfg file)
unsigned tuneClientAutoRemoveMins;
......@@ -177,6 +178,11 @@ class Config : public AbstractConfig
return tuneNumWorkers;
}
unsigned getTuneNumQuotaWorkers() const
{
return tuneNumQuotaWorkers;
}
unsigned getTuneClientAutoRemoveMins() const
{
return tuneClientAutoRemoveMins;
......
......@@ -56,11 +56,24 @@ void InternodeSyncer::syncLoop()
const int sleepIntervalMS = 5*1000; // 5sec
// If (undocumented) sysUpdateTargetStatesSecs is set in config, use that value, otherwise
// default to 1/3 sysTargetOfflineTimeoutSecs.
// default to 1/6 sysTargetOfflineTimeoutSecs.
const unsigned updateStatesMS =
(cfg->getSysUpdateTargetStatesSecs() != 0)
? cfg->getSysUpdateTargetStatesSecs() * 1000
: cfg->getSysTargetOfflineTimeoutSecs() * 333;
: cfg->getSysTargetOfflineTimeoutSecs() * 166;
// Set POffline timout to half the Offline timeout.
const unsigned targetPOfflineTimeoutMS = cfg->getSysTargetOfflineTimeoutSecs() * 333;
// The updateStates interval is used by the other nodes to ask the Mgmtd for the states,
// which should happen at least twice between POffline and Offline timeouts - 1/3 of the
// Offline - POffline interval ensures that, even if the remote InternodeSyncer is delayed for
// some reason.
// The POffline timeout in the v6 is chosen to that the POffline state will be reported to
// clients for at least 1.5 UpdateTargetStates (in clients which have a 6.3 or older default
// config, this value defaults to 60s), so that they have the chance to see the POffline state at
// least once even if their InternodeSyncer experiences a delay. The updateStates interval is
// also used by the other nodes to ask the Mgmtd for the states,
// Is very short on the first loop, so that the targets can be assigned to pools quickly. When
// the first capacity pools update has happened, this delay will be increased.
......@@ -75,8 +88,7 @@ void InternodeSyncer::syncLoop()
Time lastTargetMappingsSaveT;
Time lastIdleDisconnectT;
while(!waitForSelfTerminateOrder(sleepIntervalMS) )
while(!waitForSelfTerminateOrder(sleepIntervalMS))
{
// On the first loop, send out a request for the metadata and storage servers to publish
// their free capacity information. This way we can assign them to capacity pools with a much
......@@ -97,8 +109,6 @@ void InternodeSyncer::syncLoop()
{
bool statesModified = false;
const unsigned targetPOfflineTimeoutMS = (3 * sleepIntervalMS) + (2 * updateStatesMS);
statesModified |= mgmtdTargetStateStore->autoOfflineTargets(targetPOfflineTimeoutMS,
targetOfflineTimeoutMS, app->getStorageBuddyGroupMapper() );
......@@ -129,7 +139,7 @@ void InternodeSyncer::syncLoop()
lastCapacityPoolsUpdateT.setToNow();
// Increase timeout after first capacity update.
updateCapacityPoolsMS = 3 * updateStatesMS;
updateCapacityPoolsMS = 6 * updateStatesMS;
}
if(lastTargetMappingsSaveT.elapsedMS() > saveTargetMappingsMS)
......
......@@ -45,7 +45,7 @@ bool QuotaDataRequestor::requestQuota(QuotaDataMapForTarget* outQuotaData,
QuotaInodeSupport quotaInodeSupport;
// ignore return value, update of quota data is required also when a target is off-line
requestQuotaDataAndCollectResponses(mgmtNode, storageNodes, app->getWorkQueue(), &tmpQuotaData,
requestQuotaDataAndCollectResponses(mgmtNode, storageNodes, &workQueue, &tmpQuotaData,
mapper, false, &quotaInodeSupport);
SafeRWLock lock(outQuotaResultsRWLock, SafeRWLock_WRITE); // W R I T E L O C K
......
......@@ -26,7 +26,9 @@ class QuotaDataRequestor : public GetQuotaInfo
* @param type The type of the quota data, a value of the enum QuotaDataType.
* @param withSystemusersGroups True if also system users should be queried.
*/
QuotaDataRequestor(QuotaDataType type, bool withSystemusersGroups) : GetQuotaInfo()
QuotaDataRequestor(MultiWorkQueue& workQueue, QuotaDataType type,
bool withSystemusersGroups):
GetQuotaInfo(), workQueue(workQueue)
{
this->cfg.cfgTargetSelection = GETQUOTACONFIG_ALL_TARGETS_ONE_REQUEST_PER_TARGET;
this->cfg.cfgType = type;
......@@ -40,7 +42,8 @@ class QuotaDataRequestor : public GetQuotaInfo
* @param type The type of the quota data, a value of the enum QuotaDataType.
* @param id The ID to query.
*/
QuotaDataRequestor(QuotaDataType type, unsigned id) : GetQuotaInfo()
QuotaDataRequestor(MultiWorkQueue& workQueue, QuotaDataType type, unsigned id):
GetQuotaInfo(), workQueue(workQueue)
{
this->cfg.cfgTargetSelection = GETQUOTACONFIG_ALL_TARGETS_ONE_REQUEST_PER_TARGET;
this->cfg.cfgType = type;
......@@ -52,7 +55,8 @@ class QuotaDataRequestor : public GetQuotaInfo
* @param type The type of the quota data, a value of the enum QuotaDataType.
* @param idList The ID list to query.
*/
QuotaDataRequestor(QuotaDataType type, UIntList& idList) : GetQuotaInfo()
QuotaDataRequestor(MultiWorkQueue& workQueue, QuotaDataType type, UIntList& idList):
GetQuotaInfo(), workQueue(workQueue)
{
this->cfg.cfgTargetSelection = GETQUOTACONFIG_ALL_TARGETS_ONE_REQUEST_PER_TARGET;
this->cfg.cfgType = type;
......@@ -63,8 +67,9 @@ class QuotaDataRequestor : public GetQuotaInfo
/**
* Constructor for QuotaDataRequestor to collect IDs from a range of the given type.
*/
QuotaDataRequestor(QuotaDataType type, unsigned rangeStart, unsigned rangeEnd,
bool withSystemusersGroups) : GetQuotaInfo()
QuotaDataRequestor(MultiWorkQueue& workQueue, QuotaDataType type, unsigned rangeStart,
unsigned rangeEnd, bool withSystemusersGroups):
GetQuotaInfo(), workQueue(workQueue)
{
this->cfg.cfgTargetSelection = GETQUOTACONFIG_ALL_TARGETS_ONE_REQUEST_PER_TARGET;
this->cfg.cfgType = type;
......@@ -90,6 +95,8 @@ class QuotaDataRequestor : public GetQuotaInfo
}
private:
MultiWorkQueue& workQueue;
void updateQuotaDataWithResponse(QuotaDataMapForTarget* inQuotaData,
QuotaDataMapForTarget* outQuotaData, TargetMapper* mapper);
};
......
#include <app/App.h>
#include <common/components/worker/DummyWork.h>
#include <common/threading/PThread.h>
#include <common/threading/SafeRWLock.h>
#include <common/toolkit/SynchronizedCounter.h>
......@@ -35,6 +36,16 @@ QuotaManager::QuotaManager()
// load the quota data and the quota limits if possible
loadQuotaData();
const unsigned numWorkers = Program::getApp()->getConfig()->getTuneNumQuotaWorkers();
for (unsigned i = 0; i < numWorkers; i++)
{
std::unique_ptr<Worker> worker = std::unique_ptr<Worker>(new Worker(
std::string("QuotaWorker") + StringTk::uintToStr(i+1), &workQueue, QueueWorkType_DIRECT));
workerList.push_back(std::move(worker));
}
}
/**
......@@ -42,6 +53,8 @@ QuotaManager::QuotaManager()
*/
QuotaManager::~QuotaManager()
{
workerList.clear();
SAFE_DELETE(this->usedQuotaUser);
SAFE_DELETE(this->usedQuotaGroup);
......@@ -60,8 +73,23 @@ void QuotaManager::run()
{
registerSignalHandler();
for (auto iter = workerList.begin(); iter != workerList.end(); iter++)
(*iter)->start();
requestLoop();
for (auto iter = workerList.begin(); iter != workerList.end(); iter++)
{
(*iter)->selfTerminate();
// add dummy work to wake up the worker immediately for faster self termination
PersonalWorkQueue* personalQueue = (*iter)->getPersonalWorkQueue();
workQueue.addPersonalWork(new DummyWork(), personalQueue);
}
for (auto iter = workerList.begin(); iter != workerList.end(); iter++)
(*iter)->join();
log.log(Log_DEBUG, "Component stopped.");
}
catch(std::exception& e)
......@@ -214,22 +242,22 @@ bool QuotaManager::updateUsedQuota(UIntList& uidList, UIntList& gidList)
if(cfg->getQuotaQueryTypeNum() == MgmtQuotaQueryType_SYSTEM)
{
requestorUser = new QuotaDataRequestor(QuotaDataType_USER,
requestorUser = new QuotaDataRequestor(workQueue, QuotaDataType_USER,
cfg->getQuotaQueryWithSystemUsersGroups() );
requestorGroup = new QuotaDataRequestor(QuotaDataType_GROUP,
requestorGroup = new QuotaDataRequestor(workQueue, QuotaDataType_GROUP,
cfg->getQuotaQueryWithSystemUsersGroups() );
}
else if(cfg->getQuotaQueryTypeNum() == MgmtQuotaQueryType_FILE)
{
requestorUser = new QuotaDataRequestor(QuotaDataType_USER, uidList);
requestorGroup = new QuotaDataRequestor(QuotaDataType_GROUP, gidList);
requestorUser = new QuotaDataRequestor(workQueue, QuotaDataType_USER, uidList);
requestorGroup = new QuotaDataRequestor(workQueue, QuotaDataType_GROUP, gidList);
}
else
{
requestorUser = new QuotaDataRequestor(QuotaDataType_USER,
requestorUser = new QuotaDataRequestor(workQueue, QuotaDataType_USER,
cfg->getQuotaQueryUIDRangeStart(), cfg->getQuotaQueryUIDRangeEnd(),
cfg->getQuotaQueryWithSystemUsersGroups() );
requestorGroup = new QuotaDataRequestor(QuotaDataType_GROUP,
requestorGroup = new QuotaDataRequestor(workQueue, QuotaDataType_GROUP,
cfg->getQuotaQueryGIDRangeStart(), cfg->getQuotaQueryGIDRangeEnd(),
cfg->getQuotaQueryWithSystemUsersGroups() );
}
......@@ -451,7 +479,6 @@ bool QuotaManager::pushExceededQuotaIDs()
{
App* app = Program::getApp();
ExceededQuotaStore* exQuotaStore = app->getQuotaManager()->getExceededQuotaStore();
MultiWorkQueue* workQ = app->getWorkQueue();
auto storageNodeList = app->getStorageNodes()->referenceAllNodes();
auto metadataNodeList = app->getMetaNodes()->referenceAllNodes();
......@@ -493,7 +520,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_USER, QuotaLimitType_SIZE,
**nodeIter, messageNumber, &exceededQuotaUIDSize, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -506,7 +533,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_USER, QuotaLimitType_SIZE,
**nodeIter, messageNumber, &exceededQuotaUIDSize, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -519,7 +546,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_USER, QuotaLimitType_INODE,
**nodeIter, messageNumber, &exceededQuotaUIDInodes, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -532,7 +559,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_USER, QuotaLimitType_INODE,
**nodeIter, messageNumber, &exceededQuotaUIDInodes, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -545,7 +572,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_GROUP, QuotaLimitType_SIZE,
**nodeIter, messageNumber, &exceededQuotaGIDSize, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -558,7 +585,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_GROUP, QuotaLimitType_SIZE,
**nodeIter, messageNumber, &exceededQuotaGIDSize, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -571,7 +598,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_GROUP, QuotaLimitType_INODE,
**nodeIter, messageNumber, &exceededQuotaGIDInodes, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......@@ -584,7 +611,7 @@ bool QuotaManager::pushExceededQuotaIDs()
{
Work* work = new SetExceededQuotaWork(QuotaDataType_GROUP, QuotaLimitType_INODE,
**nodeIter, messageNumber, &exceededQuotaGIDInodes, &counter, &nodeResults[numWorks]);
workQ->addDirectWork(work);
workQueue.addDirectWork(work);
numWorks++;
}
......
......@@ -2,6 +2,7 @@
#define QUOTAMANAGER_H_
#include <common/app/log/LogContext.h>
#include <common/components/worker/Worker.h>
#include <common/storage/quota/GetQuotaInfo.h>
#include <common/storage/quota/ExceededQuotaStore.h>
#include <common/storage/quota/QuotaDefaultLimits.h>
......@@ -53,6 +54,10 @@ class QuotaManager : public PThread
AtomicInt16 limitChanged;
// QuotaManager will have its own workqueue
MultiWorkQueue workQueue;
std::list<std::unique_ptr<Worker>> workerList;
void requestLoop();
bool updateUsedQuota(UIntList& uidList, UIntList& gidList);
......
......@@ -396,7 +396,7 @@ UInt16Vector MgmtdTargetStateStore::findDoubleResync()
if (primaryState == onlineNeedsResyncState)
{
CombinedTargetState secondaryState;
const bool secondaryStateRes = getState(secondaryTargetID, secondaryState);
const bool secondaryStateRes = getStateUnlocked(secondaryTargetID, secondaryState);
if (!secondaryStateRes)
{
......
......@@ -67,13 +67,13 @@ void InternodeSyncer::syncLoop()
const unsigned downloadNodesIntervalMS = 600000; // 10min
// If (undocumented) sysUpdateTargetStatesSecs is set in config, use that value, otherwise
// default to 1/3 sysTargetOfflineTimeoutSecs.
// default to 1/6 sysTargetOfflineTimeoutSecs.
const unsigned updateTargetStatesMS =
(cfg->getSysUpdateTargetStatesSecs() != 0)
? cfg->getSysUpdateTargetStatesSecs() * 1000
: cfg->getSysTargetOfflineTimeoutSecs() * 333;
: cfg->getSysTargetOfflineTimeoutSecs() * 166;
const unsigned updateCapacitiesMS = updateTargetStatesMS * 2;
const unsigned updateCapacitiesMS = updateTargetStatesMS * 4;
Time lastCacheSweepT;
Time lastIdleDisconnectT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment