Event Detector Issues
Fix anomalies not generating: Redis connection timeouts and bad anomaly end stamps.
Below are the Event Detector issues:
- Anomalies are not Generating
- Case 1: Connection Timeout to Redis Nodes
- Case 2: The End Stamp of the Anomaly Creation is Less than the Start Time
For the Linux commands referenced below, see Basic Commands.
Anomalies are not Generating#
Case 1: Connection Timeout to Redis Nodes#
Even though the threshold for a KPI is breached, anomalies are not generated. In event detector logs, we can see connection timeout to redis nodes.
Suppressed: io.lettuce.core.RedisConnectionException: Unable to
connect to [redis-node1.example:7001]: Timeout after 20 second(s)
at
io.lettuce.core.cluster.topology.DefaultClusterTopologyRefresh.lambda
$openConnections$11(DefaultClusterTopologyRefresh.java:324)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTim
er.java:715)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor
.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheel
Timer.java:703)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(Hash
edWheelTimer.java:790)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocal
Runnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: io.lettuce.core.RedisConnectionException: Unable to
connect to [redis-node2.example:7002]: Timeout after 20 second(s)
at
io.lettuce.core.cluster.topology.DefaultClusterTopologyRefresh.lambda
$openConnections$11(DefaultClusterTopologyRefresh.java:324)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTim
er.java:715)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor
.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheel
Timer.java:703)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(Hash
edWheelTimer.java:790)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocal
Runnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: io.lettuce.core.RedisConnectionException: Unable to
connect to [redis-node3.example:7003]: Timeout after 20 second(s)
at
io.lettuce.core.cluster.topology.DefaultClusterTopologyRefresh.lambda
$openConnections$11(DefaultClusterTopologyRefresh.java:324)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTim
er.java:715)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor
.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheel
Timer.java:703)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(Hash
edWheelTimer.java:790)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocal
Runnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: io.lettuce.core.RedisConnectionException: Unable to
connect to [redis-node4.example:7004]: Timeout after 20 second(s)
at
io.lettuce.core.cluster.topology.DefaultClusterTopologyRefresh.lambda
$openConnections$11(DefaultClusterTopologyRefresh.java:324)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTim
er.java:715)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor
.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheel
Timer.java:703)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(Hash
edWheelTimer.java:790)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocal
Runnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: io.lettuce.core.RedisConnectionException: Unable to
connect to [redis-node5.example:7005]: Timeout after 20 second(s)
at
io.lettuce.core.cluster.topology.DefaultClusterTopologyRefresh.lambda
$openConnections$11(DefaultClusterTopologyRefresh.java:324)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTim
er.java:715)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor
.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheel
Timer.java:703)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(Hash
edWheelTimer.java:790)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocal
Runnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Suppressed: io.lettuce.core.RedisConnectionException: Unable to
connect to [redis-node6.example:7006]: Timeout after 20 second(s)
at
io.lettuce.core.cluster.topology.DefaultClusterTopologyRefresh.lambda
$openConnections$11(DefaultClusterTopologyRefresh.java:324)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTim
er.java:715)
at
io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor
.java:34)
at
io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheel
Timer.java:703)
at
io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(Hash
edWheelTimer.java:790)
at
io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocal
Runnable.java:30)
at java.base/java.lang.Thread.run(Unknown Source)
Server analysis : In this server, single node redis setup is present. Below was the consul key updated.
service/redis/nodes:redis-node1.example:7001,redis-
node2.example:7002,redis-node3.example:7003,redis-
node4.example:7004,redis-node5.example:7005,redis-
node6.example:7006
As our server’s /etc/hosts resolves only redis-node1.example, so event-detector is unable to connect to redis with existing configuration.
Solution : We have updated below consul keys with proper values.
service/redis/nodes:redis-node1.example:7001,redis-
node1.example:7002,redis-node1.example:7003,redis-
node1.example:7004,redis-node1.example:7005,redis-
node1.example:7006
service/redis/node1/port/db1:6001
service/redis/node1/port/dbssl1:7001
service/redis/node1/port/gossip1:16001
service/redis/node1/port/gossipssl1:17001
We cleared the redis data directories, restarted redis and created cluster manually. We also restarted event-detector module post which it was able to connect to redis and anomalies started generating.
Case 2: The End Stamp of the Anomaly Creation is Less than the Start Time#
Issue: Anomalies are not generated despite threshold breach. Upon investigation, it was found that for certain KPIs, the anomaly creation's end timestamp is set earlier than its start time, which contradicts the expected logic where the end time should be later.
RCA: The anomaly alerts were not triggered because the end time for the KPIs in question was incorrectly earlier than the start time.
According to the system's logic, the end time should either be greater than the start time or null. Database migration accidently modified timestamps (start, end, update times) for approximately 50 KPIs in Percona.
Manually setting the end time to null for the affected KPI restores the anomaly alerts. It's noted that the system's code does not automatically update the end time if not specifically touched.
SELECT * FROM service_kpi_thresholds WHERE service_id=1235 AND
kpi_id=378;
Solution:
Manually update the end time to null for the affected KPI to resume anomaly alerts:
UPDATE service_kpi_thresholds SET end_time=NULL WHERE
service_id=1235 AND kpi_id=378 AND id=10659;
Additional Adjustments:
Set the Consul keys for the thread pool core size and max size to 200 to address the issue further:
service/redismicroservice/threadpoolcoresize:200
service/redismicroservice/threadpoolmaxsize:200
Following these changes, the values will be updated in Redis successfully, ensuring the system to accurately reflect the intended configurations and thresholds for anomaly detection.
Next
- Redis Issues — diagnose the connection timeouts and cluster configuration behind Case 1.
- Alerts and Anomaly Issues — when a threshold breach still does not surface an anomaly or alert.
- Troubleshooting Overview — the full index of component runbooks.