Icinga DB: keep state checksums consistent

I.e. make hashes in hashmaps and stream the same.
This commit is contained in:
Alexander A. Klimov 2021-07-29 12:43:40 +02:00
parent 5c10fffa3b
commit 8476627e91
1 changed files with 1 additions and 1 deletions

View File

@ -1526,9 +1526,9 @@ void IcingaDB::SendStatusUpdate(const Checkable::Ptr& checkable)
tie(host, service) = GetHostService(checkable); tie(host, service) = GetHostService(checkable);
objectAttrs->Set("checksum", HashValue(objectAttrs));
objectAttrs->Set("redis_key", service ? "icinga:service:state" : "icinga:host:state"); objectAttrs->Set("redis_key", service ? "icinga:service:state" : "icinga:host:state");
objectAttrs->Set("runtime_type", "upsert"); objectAttrs->Set("runtime_type", "upsert");
objectAttrs->Set("checksum", HashValue(objectAttrs));
for (const Dictionary::Pair& kv : objectAttrs) { for (const Dictionary::Pair& kv : objectAttrs) {
streamadd.emplace_back(kv.first); streamadd.emplace_back(kv.first);