+ static int probed = 0;
+
+ if (TIME < (config->cluster_last_hb + config->cluster_hb_timeout))
+ {
+ // If the master is late (missed 2 hearbeats by a second and a
+ // hair) it may be that the switch has dropped us from the
+ // multicast group, try unicasting one probe to the master
+ // which will hopefully respond with a unicast heartbeat that
+ // will allow us to limp along until the querier next runs.
+ if (config->cluster_master_address
+ && TIME > (config->cluster_last_hb + 2 * config->cluster_hb_interval + 11))
+ {
+ if (!probed)
+ {
+ probed = 1;
+ log(1, 0, 0, 0, "Heartbeat from master %.1fs late, probing...\n",
+ TIME - (config->cluster_last_hb + config->cluster_hb_interval));
+
+ peer_send_message(config->cluster_master_address,
+ C_LASTSEEN, config->cluster_seq_number, NULL, 0);
+ }
+ } else { // We got a recent heartbeat; reset the probe flag.
+ probed = 0;
+ }