mirror of
https://github.com/Icinga/icinga2.git
synced 2026-04-22 14:47:07 -04:00
Revert "IcingaDB: suppress state sync until config sync finished"
This reverts commit f6f7d9b635 and all
other its new users.
This commit is contained in:
parent
d364ad981e
commit
adbefa5540
4 changed files with 2 additions and 43 deletions
|
|
@ -227,14 +227,6 @@ void IcingaDB::UpdateAllConfigObjects()
|
|||
WorkQueue upq(25000, Configuration::Concurrency, LogNotice);
|
||||
upq.SetName("IcingaDB:ConfigDump");
|
||||
|
||||
m_RconWorker->SuppressQueryKind(Prio::CheckResult);
|
||||
m_RconWorker->SuppressQueryKind(Prio::RuntimeStateSync);
|
||||
|
||||
Defer unSuppress ([this]() {
|
||||
m_RconWorker->UnsuppressQueryKind(Prio::RuntimeStateSync);
|
||||
m_RconWorker->UnsuppressQueryKind(Prio::CheckResult);
|
||||
});
|
||||
|
||||
// Add a new type=* state=wip entry to the stream and remove all previous entries (MAXLEN 1).
|
||||
m_RconWorker->FireAndForgetQuery({"XADD", "icinga:dump", "MAXLEN", "1", "*", "key", "*", "state", "wip"}, Prio::Config);
|
||||
|
||||
|
|
|
|||
|
|
@ -125,9 +125,6 @@ void IcingaDB::Start(bool runtimeCreated)
|
|||
|
||||
m_WorkQueue.SetName("IcingaDB");
|
||||
|
||||
m_RconWorker->SuppressQueryKind(Prio::CheckResult);
|
||||
m_RconWorker->SuppressQueryKind(Prio::RuntimeStateSync);
|
||||
|
||||
Ptr keepAlive (this);
|
||||
|
||||
m_HistoryThread = std::async(std::launch::async, [this, keepAlive]() { ForwardHistoryEntries(); });
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ double RedisConnection::GetOldestPendingQueryTs()
|
|||
double oldest = 0;
|
||||
|
||||
for (auto& queue : m_Queues.Writes) {
|
||||
if (m_SuppressedQueryKinds.find(queue.first) == m_SuppressedQueryKinds.end() && !queue.second.empty()) {
|
||||
if (!queue.second.empty()) {
|
||||
auto ctime (queue.second.front().CTime);
|
||||
|
||||
if (ctime < oldest || oldest == 0) {
|
||||
|
|
@ -274,29 +274,6 @@ double RedisConnection::GetOldestPendingQueryTs()
|
|||
return future.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark kind as kind of queries not to actually send yet
|
||||
*
|
||||
* @param kind Query kind
|
||||
*/
|
||||
void RedisConnection::SuppressQueryKind(RedisConnection::QueryPriority kind)
|
||||
{
|
||||
asio::post(m_Strand, [this, kind]() { m_SuppressedQueryKinds.emplace(kind); });
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmark kind as kind of queries not to actually send yet
|
||||
*
|
||||
* @param kind Query kind
|
||||
*/
|
||||
void RedisConnection::UnsuppressQueryKind(RedisConnection::QueryPriority kind)
|
||||
{
|
||||
asio::post(m_Strand, [this, kind]() {
|
||||
m_SuppressedQueryKinds.erase(kind);
|
||||
m_QueuedWrites.Set();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Try to connect to Redis
|
||||
*/
|
||||
|
|
@ -474,7 +451,7 @@ void RedisConnection::WriteLoop(asio::yield_context& yc)
|
|||
|
||||
WriteFirstOfHighestPrio:
|
||||
for (auto& queue : m_Queues.Writes) {
|
||||
if (m_SuppressedQueryKinds.find(queue.first) != m_SuppressedQueryKinds.end() || queue.second.empty()) {
|
||||
if (queue.second.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@
|
|||
#include <map>
|
||||
#include <memory>
|
||||
#include <queue>
|
||||
#include <set>
|
||||
#include <stdexcept>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
|
@ -188,9 +187,6 @@ struct RedisConnInfo final : SharedObject
|
|||
void Sync();
|
||||
double GetOldestPendingQueryTs();
|
||||
|
||||
void SuppressQueryKind(QueryPriority kind);
|
||||
void UnsuppressQueryKind(QueryPriority kind);
|
||||
|
||||
void SetConnectedCallback(std::function<void(boost::asio::yield_context& yc)> callback);
|
||||
|
||||
int GetQueryCount(RingBuffer::SizeType span);
|
||||
|
|
@ -320,9 +316,6 @@ struct RedisConnInfo final : SharedObject
|
|||
std::queue<FutureResponseAction> FutureResponseActions;
|
||||
} m_Queues;
|
||||
|
||||
// Kinds of queries not to actually send yet
|
||||
std::set<QueryPriority> m_SuppressedQueryKinds;
|
||||
|
||||
// Indicate that there's something to send/receive
|
||||
AsioEvent m_QueuedWrites;
|
||||
AsioDualEvent m_QueuedReads;
|
||||
|
|
|
|||
Loading…
Reference in a new issue