Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -53,7 +53,7 @@ bool HandlerLockedTopics::init()
auto cbDatabase = [this](const Database::OpmLockedTopics & data)
{
DEBUG_LOG() << "Locked topic from db: " << data.exerciseId.toInt() << ", " << data.workstationId
DEBUG_LOG(m_logger) << "Locked topic from db: " << data.exerciseId.toInt() << ", " << data.workstationId
<< ", " << data.operatorId << data.entityTypeName;
m_lockedTopics.insert(Core::key(data.entityId, data.exerciseId.isNull() ? 0 : data.exerciseId.toInt(), data.entityTypeName), data);
};
@@ -89,7 +89,7 @@ void HandlerLockedTopics::operatorLoggedInOut(int operatorId, int workstationId)
{
// check if there are stale locks (e.g. by crashing client) - then remove all of them - if there are any
DEBUG_LOG() << "operatorLoggedInOut: " << workstationId << ", " << operatorId;
DEBUG_LOG(m_logger) << "operatorLoggedInOut: " << workstationId << ", " << operatorId;
// Ueberall wurden - ohne erase wohlgemerkt - mutable Iteratoren verwendet. Nur hier - wo erase verwendet wurde - nicht! :')
QMutableHashIterator<Core::key, Database::OpmLockedTopics> it(m_lockedTopics);
@@ -98,7 +98,7 @@ void HandlerLockedTopics::operatorLoggedInOut(int operatorId, int workstationId)
{
const auto lockedTopic = it.next().value();
DEBUG_LOG() << "check if unlock: id=" << lockedTopic.id
DEBUG_LOG(m_logger) << "check if unlock: id=" << lockedTopic.id
<< ", exId=" << lockedTopic.exerciseId.toInt()
<< ", wsId=" << lockedTopic.workstationId
<< ", opId=" << lockedTopic.operatorId;
@@ -107,7 +107,7 @@ void HandlerLockedTopics::operatorLoggedInOut(int operatorId, int workstationId)
continue;
}
DEBUG_LOG() << "Unlocking topic: id=" << lockedTopic.id
DEBUG_LOG(m_logger) << "Unlocking topic: id=" << lockedTopic.id
<< ", exId=" << lockedTopic.exerciseId.toInt()
<< ", wsId=" << lockedTopic.workstationId
<< ", opId=" << lockedTopic.operatorId;
@@ -126,11 +126,11 @@ void HandlerLockedTopics::onTryLockEntityRequest(const rti::core::SampleIdentity
auto ret = tryLock(request);
if (!ret.errorString().empty())
{
WARNING_LOG() << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
WARNING_LOG(m_logger) << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
}
else if (ret.alreadyLocked())
{
WARNING_LOG() << "onTryLockEntityRequest failed because the topic was already locked by ws " << ret.alreadyLocked().get().workstationName() << " and op " << ret.alreadyLocked().get().operatorName() << " - " << request;
WARNING_LOG(m_logger) << "onTryLockEntityRequest failed because the topic was already locked by ws " << ret.alreadyLocked().get().workstationName() << " and op " << ret.alreadyLocked().get().operatorName() << " - " << request;
}
m_ftsTryLockEntity->sendReply(cookie, ret);
@@ -155,7 +155,7 @@ Core::TryLockEntityReply lockSuccessReply(const Database::OpmLockedTopics &dbStr
Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityRequest &request)
{
DEBUG_LOG() << "tryLock : " << request;
DEBUG_LOG(m_logger) << "tryLock : " << request;
const auto topicId = request.entityId();
@@ -191,7 +191,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
//Core::TryLockEntityReply HandlerLockedTopics::tryLockModify(const Core::TryLockEntityRequest &request)
//{
// DEBUG_LOG() << "tryLockModify: " << request;
// DEBUG_LOG(m_logger) << "tryLockModify: " << request;
// const auto lockEntityId = request.id();
@@ -260,7 +260,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
// }
// const Database::OpmLockedTopics &lockedTopic = *lockedTopicIt;
// DEBUG_LOG() << Q_FUNC_INFO << ": locked topic id " << lockedTopic.id;
// DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": locked topic id " << lockedTopic.id;
// // ... and then reinserting the updated lock entity (as the id has now changed) - while the key (op, ws, exc, topic id) stays the same!
// m_lockedTopics[requestedKey] = dbStruct;
// }
@@ -270,7 +270,7 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
//bool HandlerLockedTopics::removeReleaseOutdatedLock(const int lockEntityId)
//{
// DEBUG_LOG() << "removeReleaseOutdatedLock: lockEntityId = " << lockEntityId;
// DEBUG_LOG(m_logger) << "removeReleaseOutdatedLock: lockEntityId = " << lockEntityId;
// auto lockedTopicIt = std::find_if(m_lockedTopics.constBegin(), m_lockedTopics.constEnd(),
// [&lockEntityId](const Database::OpmLockedTopics &lockedTopic)
@@ -280,13 +280,13 @@ Core::TryLockEntityReply HandlerLockedTopics::tryLock(const Core::TryLockEntityR
// if (lockedTopicIt == m_lockedTopics.constEnd())
// {
// ERROR_LOG() << Q_FUNC_INFO << ": Failed to release outdated lock as lock entity id ("<<lockedTopicIt<<") was not found!";
// ERROR_LOG(m_logger) << Q_FUNC_INFO << ": Failed to release outdated lock as lock entity id ("<<lockedTopicIt<<") was not found!";
// Q_ASSERT(false);
// return false;
// }
// const Database::OpmLockedTopics &lockedTopic = *lockedTopicIt;
// DEBUG_LOG() << Q_FUNC_INFO << ": found lock entity " << lockEntityId;
// DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": found lock entity " << lockEntityId;
// unlockInDb(lockedTopic);
// removeLockedEntity(lockEntityId);
@@ -305,7 +305,7 @@ void HandlerLockedTopics::onTryUnlockEntityRequest(const rti::core::SampleIdenti
auto ret = tryUnlock(request);
if (!ret.errorString().empty())
{
WARNING_LOG() << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
WARNING_LOG(m_logger) << Core::FunctionReplyObject(ret.FunctionReply::id(), ret.errorString(), ret.errorParams()).translated() << " - " << request;
}
m_ftsTryUnlockEntity->sendReply(cookie, ret);
@@ -315,7 +315,7 @@ void HandlerLockedTopics::onTryUnlockEntityRequest(const rti::core::SampleIdenti
Core::FunctionReply HandlerLockedTopics::tryUnlock(const Core::TryUnlockEntityRequest &request)
{
DEBUG_LOG() << "tryUnlock: " << request;
DEBUG_LOG(m_logger) << "tryUnlock: " << request;
const auto lockEntityId = request.id();
@@ -366,7 +366,7 @@ bool HandlerLockedTopics::publishLockedEntity(const Core::LockedEntity &entity)
m_dtsLockedEntity->write(entity);
return true;
}
ERROR_LOG() << "Publishing LockedEntity " << entity.id() << " failed: DTS not available!";
ERROR_LOG(m_logger) << "Publishing LockedEntity " << entity.id() << " failed: DTS not available!";
return false;
}
@@ -379,7 +379,7 @@ bool HandlerLockedTopics::removeLockedEntity(int64_t id)
m_dtsLockedEntity->remove(entity);
return true;
}
ERROR_LOG() << "Removing LockedEntity " << entity.id() << " failed: DTS not available!";
ERROR_LOG(m_logger) << "Removing LockedEntity " << entity.id() << " failed: DTS not available!";
return false;
}
@@ -404,14 +404,14 @@ void HandlerLockedTopics::dumpLockedTopics(int line)
{
QHashIterator<Core::key, Database::OpmLockedTopics> it (m_lockedTopics);
INFO_LOG() << " dump m_lockedTopics, START size= " << m_lockedTopics.size()
INFO_LOG(m_logger) << " dump m_lockedTopics, START size= " << m_lockedTopics.size()
<< " (callerline=" << line << ")";
while (it.hasNext())
{
it.next();
const Core::key &keyRef = it.key();
const Database::OpmLockedTopics &valRef = it.value();
INFO_LOG() << " entityTypeName=" << keyRef.entityTypeName << "'"
INFO_LOG(m_logger) << " entityTypeName=" << keyRef.entityTypeName << "'"
<< ", entityId=" << keyRef.entityId
<< ", exerciseId=" << keyRef.exerciseId
<< " - eTN=" << valRef.entityTypeName
@@ -419,7 +419,7 @@ void HandlerLockedTopics::dumpLockedTopics(int line)
<< ", exId=" << valRef.exerciseId.toInt()
<< ", opId=" << valRef.operatorId;
}
INFO_LOG() << " dump m_lockedTopics, END size= " << m_lockedTopics.size();
INFO_LOG(m_logger) << " dump m_lockedTopics, END size= " << m_lockedTopics.size();
}
} // namespace