Xinyu Tan created RATIS-1573:
--------------------------------
Summary: Optimize followerState interrupt log
Key: RATIS-1573
URL: https://issues.apache.org/jira/browse/RATIS-1573
Project: Ratis
Issue Type: Wish
Affects Versions: 2.2.0
Reporter: Xinyu Tan
In the current Ratis implementation, once any instance is started and an
election is successful, a log of "Sleep Interrupt" is always posted in the log,
as shown below, which is confusing because nothing seems to be wrong. Can we
adjust the level of this log to a lower level or adjust the logic so that
interrupt's log does not appear anymore.
{code:java}
3872 [grpc-default-executor-0] INFO o.apache.ratis.server.impl.RoleInfo -
127.0.0.1-6002: start 127.0.0.1-6002@group-474747474747-FollowerState
3874 [grpc-default-executor-0] INFO o.a.r.server.RaftServer$Division -
127.0.0.1-6002@group-474747474747 replies to ELECTION vote request:
127.0.0.1-6000<-127.0.0.1-6002#0:OK-t1. Peer's state:
127.0.0.1-6002@group-474747474747:t1, leader=null, voted=127.0.0.1-6000,
raftlog=127.0.0.1-6002@group-474747474747-SegmentedRaftLog:OPENED:c-1, conf=-1:
[127.0.0.1-6002|rpc:127.0.0.1:6002|admin:|client:|dataStream:|priority:0,
127.0.0.1-6000|rpc:127.0.0.1:6000|admin:|client:|dataStream:|priority:0,
127.0.0.1-6001|rpc:127.0.0.1:6001|admin:|client:|dataStream:|priority:0],
old=null
3878 [127.0.0.1-6002@group-474747474747-FollowerState] INFO
o.a.ratis.server.impl.FollowerState -
127.0.0.1-6002@group-474747474747-FollowerState was interrupted: {}
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at java.lang.Thread.sleep(Thread.java:340)
at java.util.concurrent.TimeUnit.sleep(TimeUnit.java:386)
at org.apache.ratis.util.TimeDuration.sleep(TimeDuration.java:324)
at org.apache.ratis.util.TimeDuration.sleep(TimeDuration.java:309)
at org.apache.ratis.server.impl.FollowerState.run(FollowerState.java:118)
3883 [127.0.0.1-6000@group-474747474747-LeaderElection1] INFO
o.a.r.server.impl.LeaderElection -
127.0.0.1-6000@group-474747474747-LeaderElection1: ELECTION PASSED received 1
response(s) and 0 exception(s):
3883 [127.0.0.1-6000@group-474747474747-LeaderElection1] INFO
o.a.r.server.impl.LeaderElection - Response 0:
127.0.0.1-6000<-127.0.0.1-6002#0:OK-t1 {code}
--
This message was sent by Atlassian Jira
(v8.20.7#820007)