mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 21:55:03 +02:00
cluster: Ignore old messages.
This commit is contained in:
parent
a00a28d31b
commit
82afdc92c8
@ -769,7 +769,14 @@ void ClusterComponent::AcknowledgementClearedHandler(const Service::Ptr& service
|
||||
|
||||
void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Dictionary::Ptr& message)
|
||||
{
|
||||
if (message->Contains("ts") && sender->GetRemoteLogPosition() + 10 < message->Get("ts")) {
|
||||
if (message->Contains("ts")) {
|
||||
double ts = message->Get("ts");
|
||||
|
||||
/* ignore old messages */
|
||||
if (ts < sender->GetRemoteLogPosition())
|
||||
return;
|
||||
|
||||
if (sender->GetRemoteLogPosition() + 10 < ts) {
|
||||
Dictionary::Ptr lparams = boost::make_shared<Dictionary>();
|
||||
lparams->Set("log_position", message->Get("ts"));
|
||||
|
||||
@ -784,6 +791,7 @@ void ClusterComponent::MessageHandler(const Endpoint::Ptr& sender, const Diction
|
||||
|
||||
Log(LogInformation, "cluster", "Acknowledging log position for identity '" + sender->GetName() + "': " + Utility::FormatDateTime("%Y/%m/%d %H:%M:%S", message->Get("ts")));
|
||||
}
|
||||
}
|
||||
|
||||
RelayMessage(sender, message, true);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user