Skip to content

Commit 6ec40d6

Browse files
committed
Revert "IcingaDB: suppress state sync until config sync finished"
This reverts commit f6f7d9b and all other its new users.
1 parent 538c766 commit 6ec40d6

File tree

4 files changed

+2
-43
lines changed

4 files changed

+2
-43
lines changed

lib/icingadb/icingadb-objects.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,6 @@ void IcingaDB::UpdateAllConfigObjects()
214214

215215
std::vector<Type::Ptr> types = GetTypes();
216216

217-
m_Rcon->SuppressQueryKind(Prio::CheckResult);
218-
m_Rcon->SuppressQueryKind(Prio::RuntimeStateSync);
219-
220-
Defer unSuppress ([this]() {
221-
m_Rcon->UnsuppressQueryKind(Prio::RuntimeStateSync);
222-
m_Rcon->UnsuppressQueryKind(Prio::CheckResult);
223-
});
224-
225217
// Add a new type=* state=wip entry to the stream and remove all previous entries (MAXLEN 1).
226218
m_Rcon->FireAndForgetQuery({"XADD", "icinga:dump", "MAXLEN", "1", "*", "key", "*", "state", "wip"}, Prio::Config);
227219

lib/icingadb/icingadb.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ void IcingaDB::Start(bool runtimeCreated)
127127

128128
m_WorkQueue.SetName("IcingaDB");
129129

130-
m_Rcon->SuppressQueryKind(Prio::CheckResult);
131-
m_Rcon->SuppressQueryKind(Prio::RuntimeStateSync);
132-
133130
Ptr keepAlive (this);
134131

135132
m_HistoryThread = std::async(std::launch::async, [this, keepAlive]() { ForwardHistoryEntries(); });

lib/icingadb/redisconnection.cpp

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ double RedisConnection::GetOldestPendingQueryTs()
299299
double oldest = 0;
300300

301301
for (auto& queue : m_Queues.Writes) {
302-
if (m_SuppressedQueryKinds.find(queue.first) == m_SuppressedQueryKinds.end() && !queue.second.empty()) {
302+
if (!queue.second.empty()) {
303303
auto ctime (queue.second.front().CTime);
304304

305305
if (ctime < oldest || oldest == 0) {
@@ -315,29 +315,6 @@ double RedisConnection::GetOldestPendingQueryTs()
315315
return future.get();
316316
}
317317

318-
/**
319-
* Mark kind as kind of queries not to actually send yet
320-
*
321-
* @param kind Query kind
322-
*/
323-
void RedisConnection::SuppressQueryKind(RedisConnection::QueryPriority kind)
324-
{
325-
asio::post(m_Strand, [this, kind]() { m_SuppressedQueryKinds.emplace(kind); });
326-
}
327-
328-
/**
329-
* Unmark kind as kind of queries not to actually send yet
330-
*
331-
* @param kind Query kind
332-
*/
333-
void RedisConnection::UnsuppressQueryKind(RedisConnection::QueryPriority kind)
334-
{
335-
asio::post(m_Strand, [this, kind]() {
336-
m_SuppressedQueryKinds.erase(kind);
337-
m_QueuedWrites.Set();
338-
});
339-
}
340-
341318
/**
342319
* Try to connect to Redis
343320
*/
@@ -518,7 +495,7 @@ void RedisConnection::WriteLoop(asio::yield_context& yc)
518495

519496
WriteFirstOfHighestPrio:
520497
for (auto& queue : m_Queues.Writes) {
521-
if (m_SuppressedQueryKinds.find(queue.first) != m_SuppressedQueryKinds.end() || queue.second.empty()) {
498+
if (queue.second.empty()) {
522499
continue;
523500
}
524501

lib/icingadb/redisconnection.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <map>
3838
#include <memory>
3939
#include <queue>
40-
#include <set>
4140
#include <stdexcept>
4241
#include <utility>
4342
#include <vector>
@@ -103,9 +102,6 @@ namespace icinga
103102
void Sync();
104103
double GetOldestPendingQueryTs();
105104

106-
void SuppressQueryKind(QueryPriority kind);
107-
void UnsuppressQueryKind(QueryPriority kind);
108-
109105
void SetConnectedCallback(std::function<void(boost::asio::yield_context& yc)> callback);
110106

111107
int GetQueryCount(RingBuffer::SizeType span);
@@ -237,9 +233,6 @@ namespace icinga
237233
std::queue<FutureResponseAction> FutureResponseActions;
238234
} m_Queues;
239235

240-
// Kinds of queries not to actually send yet
241-
std::set<QueryPriority> m_SuppressedQueryKinds;
242-
243236
// Indicate that there's something to send/receive
244237
AsioEvent m_QueuedWrites;
245238
AsioDualEvent m_QueuedReads;

0 commit comments

Comments
 (0)