Leader not aware of its leadership
Our cluster got into a state in which a leader got elected, but the elected leader wasn't aware of it's leadership, so it was refusing the requests the other leaders were proxying.
This state persisted for days until the "confused leader" was resterted.
Logs from the leader:
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,064] INFO Candidate /marathon/leader/member_0000000527 waiting for the next leader election, current voting: [member_0000000521, member_0000000522, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,064] ERROR Current member ID member_0000000492 is not a candidate for leader, current voting: [member_0000000521, member_0000000522, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,282] INFO Candidate /marathon/leader/member_0000000527 waiting for the next leader election, current voting: [member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,282] ERROR Current member ID member_0000000492 is not a candidate for leader, current voting: [member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,802] INFO Candidate /marathon/leader/member_0000000527 waiting for the next leader election, current voting: [member_0000000528, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,803] ERROR Current member ID member_0000000492 is not a candidate for leader, current voting: [member_0000000528, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,976] INFO Candidate /marathon/leader/member_0000000527 waiting for the next leader election, current voting: [member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:22,976] ERROR Current member ID member_0000000492 is not a candidate for leader, current voting: [member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:23 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:23,260] INFO Do not proxy to myself. Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv2.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-106976)
Nov 30 13:51:23 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:23,261] INFO Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv2.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-106976)
Nov 30 13:51:23 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:23,266] INFO Do not proxy to myself. Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv2.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-107011)
Nov 30 13:51:23 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:23,267] INFO Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv2.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-107011)
Nov 30 13:51:23 srv2.hw.ca1.mesosphere.com marathon[2379]: [2015-11-30 13:51:23,512] INFO Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv2.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-106976)
Logs from another master, which apparently had gotten into the same state, but managed to get out of it:
Nov 30 13:51:19 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:19,122] INFO Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv3.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-219000)
Nov 30 13:51:19 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:19,129] INFO Waiting for consistent leadership state. Are we leader?: false, leader: Some(srv3.hw.ca1.mesosphere.com:8080) (mesosphere.marathon.api.LeaderProxyFilter$:qtp983834017-219006)
Nov 30 13:51:19 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:19,366] INFO 172.16.0.14 - - [30/Nov/2015:13:51:16 +0000] "GET //srv3.hw.ca1.mesosphere.com:8080/v2/apps HTTP/1.1" 503 351 "http://ovh.marathon.io:4242/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36" 275 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219011)
Nov 30 13:51:19 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:19,373] INFO 172.16.0.14 - - [30/Nov/2015:13:51:16 +0000] "GET //srv3.hw.ca1.mesosphere.com:8080/v2/deployments HTTP/1.1" 503 358 "http://ovh.marathon.io:4242/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36" 275 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219000)
Nov 30 13:51:19 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:19,379] INFO 172.16.0.14 - - [30/Nov/2015:13:51:16 +0000] "GET //srv3.hw.ca1.mesosphere.com:8080/v2/queue HTTP/1.1" 503 352 "http://ovh.marathon.io:4242/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36" 275 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219006)
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:21,702] INFO Unable to read additional data from server sessionid 0x3515255abc00003, likely server has closed socket, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv4.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2335]: 2015-11-30 13:51:21,704:2206(0x7f1a1cbe0700):ZOO_ERROR@handle_socket_error_msg@1721: Socket [172.16.0.14:2181] zk retcode=-4, errno=112(Host is down): failed while receiving a server response
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2335]: 2015-11-30 13:51:21,704:2206(0x7f1a1cbe0700):ZOO_INFO@check_events@1703: initiated connection to server [172.16.0.15:2181]
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2335]: I1130 13:51:21.704942 14894 group.cpp:418] Lost connection to ZooKeeper, attempting to reconnect ...
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2335]: 2015-11-30 13:51:21,760:2206(0x7f1a1cbe0700):ZOO_INFO@check_events@1750: session establishment complete on server [172.16.0.15:2181], sessionId=0x15150291daa0005, negotiated timeout=10000
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2335]: I1130 13:51:21.760956 14922 group.cpp:313] Group process (group(3)@172.16.0.13:50346) reconnected to ZooKeeper
Nov 30 13:51:21 srv3.hw.ca1.mesosphere.com marathon[2335]: I1130 13:51:21.760977 14922 group.cpp:787] Syncing group operations: queue size (joins, cancels, datas) = (0, 0, 0)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,402] INFO Opening socket connection to server srv2.hw.ca1.mesosphere.com/172.16.0.12:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv2.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,402] INFO Socket connection established to srv2.hw.ca1.mesosphere.com/172.16.0.12:2181, initiating session (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv2.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,550] INFO Unable to reconnect to ZooKeeper service, session 0x3515255abc00003 has expired, closing socket connection (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv2.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,550] INFO Zookeeper session expired. Event: WatchedEvent state:Expired type:None path:null (com.twitter.common.zookeeper.ZooKeeperClient:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,550] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,551] INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,551] INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(MarathonStore(framework:)), EntityStoreCache(MarathonStore(taskFailure:)), EntityStoreCache(MarathonStore(task:)), EntityStoreCache(MarathonStore(events:)) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuic
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,551] INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,552] INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,552] INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-75)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,553] INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,553] INFO Initiating client connection, connectString=srv2.hw.ca1.mesosphere.com:2181,srv3.hw.ca1.mesosphere.com:2181,srv4.hw.ca1.mesosphere.com:2181,srv5.hw.ca1.mesosphere.com:2181,srv6.hw.ca1.mesosphere.com:2181 sessionTimeout=10000 watcher=com.twitter.common.zookeeper.ZooKeeperClient$3@2a4c6776 (org.apache.zookeeper.ZooKeeper:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,555] INFO Opening socket connection to server srv3.hw.ca1.mesosphere.com/172.16.0.13:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv3.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,555] INFO Socket connection established to srv3.hw.ca1.mesosphere.com/172.16.0.13:2181, initiating session (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv3.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,806] INFO Session establishment complete on server srv3.hw.ca1.mesosphere.com/172.16.0.13:2181, sessionid = 0x25152e0bae20017, negotiated timeout = 10000 (org.apache.zookeeper.ClientCnxn:ZookeeperClient-watcherProcessor-SendThread(srv3.hw.ca1.mesosphere.com:2181))
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,807] ERROR Current member ID member_0000000494 is not a candidate for leader, current voting: [member_0000000528, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,808] INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,808] INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(MarathonStore(framework:)), EntityStoreCache(MarathonStore(taskFailure:)), EntityStoreCache(MarathonStore(task:)), EntityStoreCache(MarathonStore(events:)) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuic
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,808] INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,808] INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,808] INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-73)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,809] INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,810] ERROR Current member ID member_0000000506 is not a candidate for leader, current voting: [member_0000000528, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,810] INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,810] INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(MarathonStore(framework:)), EntityStoreCache(MarathonStore(taskFailure:)), EntityStoreCache(MarathonStore(task:)), EntityStoreCache(MarathonStore(events:)) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuic
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,810] INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,810] INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,810] INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-76)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,811] INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,811] ERROR Current member ID member_0000000507 is not a candidate for leader, current voting: [member_0000000528, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,811] INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,811] INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(MarathonStore(framework:)), EntityStoreCache(MarathonStore(taskFailure:)), EntityStoreCache(MarathonStore(task:)), EntityStoreCache(MarathonStore(events:)) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuic
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,811] INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,811] INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,812] INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-73)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,812] INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,980] INFO Set group member ID to member_0000000529 (com.twitter.common.zookeeper.Group:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,981] ERROR Current member ID member_0000000506 is not a candidate for leader, current voting: [member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,981] ERROR Current member ID member_0000000494 is not a candidate for leader, current voting: [member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,981] INFO Candidate /marathon/leader/member_0000000529 waiting for the next leader election, current voting: [member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor)
Nov 30 13:51:22 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:51:22,982] ERROR Current member ID member_0000000507 is not a candidate for leader, current voting: [member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527] (com.twitter.common.zookeeper.CandidateImpl:ZookeeperClient-watcherProcessor-EventThread)
Nov 30 13:52:01 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:01,693] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-219003)
Nov 30 13:52:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:04,255] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-219016)
Nov 30 13:52:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:04,383] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-218989)
Nov 30 13:52:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:04,458] INFO 0:0:0:0:0:0:0:1 - - [30/Nov/2015:13:52:01 +0000] "GET //localhost:8080/v2/tasks HTTP/1.1" 503 352 "-" "python-requests/2.6.0 CPython/2.7.5 Linux/3.10.0-229.7.2.el7.x86_64" 276 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219003)
Nov 30 13:52:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:04,686] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-219012)
Nov 30 13:52:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:04,960] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-218990)
Nov 30 13:52:07 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:07,013] INFO 172.16.1.13 - - [30/Nov/2015:13:52:04 +0000] "GET //int.srv3.hw.ca1.mesosphere.com:8080/v2/tasks HTTP/1.1" 503 352 "-" "curl/7.29.0" 275 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219016)
Nov 30 13:52:07 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:07,141] INFO 172.16.1.16 - - [30/Nov/2015:13:52:04 +0000] "GET //int.srv3.hw.ca1.mesosphere.com:8080/v2/tasks HTTP/1.1" 503 352 "-" "curl/7.29.0" 275 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-218989)
Nov 30 13:52:07 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:07,448] INFO 172.16.1.15 - - [30/Nov/2015:13:52:04 +0000] "GET //int.srv3.hw.ca1.mesosphere.com:8080/v2/tasks HTTP/1.1" 503 352 "-" "curl/7.29.0" 276 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219012)
Nov 30 13:52:07 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:52:07,717] INFO 172.16.1.14 - - [30/Nov/2015:13:52:04 +0000] "GET //int.srv3.hw.ca1.mesosphere.com:8080/v2/tasks HTTP/1.1" 503 352 "-" "curl/7.29.0" 275 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-218990)
Nov 30 13:53:01 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:53:01,782] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-219000)
Nov 30 13:53:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:53:04,273] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-218954)
Nov 30 13:53:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:53:04,463] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-218987)
Nov 30 13:53:04 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:53:04,543] INFO 0:0:0:0:0:0:0:1 - - [30/Nov/2015:13:53:01 +0000] "GET //localhost:8080/v2/tasks HTTP/1.1" 503 352 "-" "python-requests/2.6.0 CPython/2.7.5 Linux/3.10.0-229.7.2.el7.x86_64" 276 (mesosphere.chaos.http.ChaosRequestLog$$EnhancerByGuice$$dac83aa5:qtp983834017-219000)
Nov 30 13:53:05 srv3.hw.ca1.mesosphere.com marathon[2332]: [2015-11-30 13:53:05,061] INFO Proxying request to GET http://srv2.hw.ca1.mesosphere.com:8080/v2/tasks from srv3.hw.ca1.mesosphere.com:8080 (mesosphere.marathon.api.JavaUrlConnectionRequestForwarder$:qtp983834017-219011)
There also was some inconsistent leadership info in Zookeeper:
ls /marathon/leader
[member_0000000528, member_0000000529, member_0000000525, member_0000000526, member_0000000527]
(There are only three Marathon instances)
Looks related to a bug @gaston and me found while testing a while ago: https://github.com/mesosphere/marathon/issues/2419
One of the reasons could be #2509
Problem starts with Zookeeper Connection Loss:
[2015-12-02 20:05:42,185] INFO Unable to read additional data from server sessionid 0x35158a982db0006, likely server has closed socket, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn:m
[2015-12-02 20:05:42,366] INFO Opening socket connection to server 172.16.0.16/172.16.0.16:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn:metrics-datadog-reporter-1-thre
[2015-12-02 20:05:43,413] INFO Socket connection established to 172.16.0.16/172.16.0.16:2181, initiating session (org.apache.zookeeper.ClientCnxn:metrics-datadog-reporter-1-thread-1-SendThread(172.16.0.16:2181))
[2015-12-02 20:05:43,457] INFO Unable to reconnect to ZooKeeper service, session 0x35158a982db0006 has expired, closing socket connection (org.apache.zookeeper.ClientCnxn:metrics-datadog-reporter-1-thread-1-SendThread(172
[2015-12-02 20:05:43,461] INFO EventThread shut down (org.apache.zookeeper.ClientCnxn:metrics-datadog-reporter-1-thread-1-EventThread)
[2015-12-02 20:05:44,018] INFO Unable to read additional data from server sessionid 0x4515e97abbc0000, likely server has closed socket, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn:q
[2015-12-02 20:05:44,018] INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
[2015-12-02 20:05:44,018] INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(Maratho
[2015-12-02 20:05:44,019] INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
[2015-12-02 20:05:44,019] INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
[2015-12-02 20:05:44,020] INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-6)
[2015-12-02 20:05:44,021] INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
[2015-12-02 20:05:44,119] WARN Temporary error re-joining group: /marathon/leader (com.twitter.common.zookeeper.Group:qtp983834017-928-EventThread)
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /marathon/leader/member_
at org.apache.zookeeper.KeeperException.create(KeeperException.java:99) ~[marathon:0.13.0-RC6]
at org.apache.zookeeper.KeeperException.create(KeeperException.java:51) ~[marathon:0.13.0-RC6]
at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:783) ~[marathon:0.13.0-RC6]
at com.twitter.common.zookeeper.Group$ActiveMembership.join(Group.java:424) [marathon:0.13.0-RC6]
at com.twitter.common.zookeeper.Group$ActiveMembership$4.get(Group.java:445) [marathon:0.13.0-RC6]
at com.twitter.common.zookeeper.Group$ActiveMembership$4.get(Group.java:442) [marathon:0.13.0-RC6]
at com.twitter.common.util.BackoffHelper$1.get(BackoffHelper.java:109) [marathon:0.13.0-RC6]
at com.twitter.common.util.BackoffHelper$1.get(BackoffHelper.java:107) [marathon:0.13.0-RC6]
at com.twitter.common.util.BackoffHelper.doUntilResult(BackoffHelper.java:127) [marathon:0.13.0-RC6]
at com.twitter.common.util.BackoffHelper.doUntilSuccess(BackoffHelper.java:107) [marathon:0.13.0-RC6]
at com.twitter.common.zookeeper.Group$ActiveMembership.tryJoin(Group.java:467) [marathon:0.13.0-RC6]
at com.twitter.common.zookeeper.Group$ActiveMembership.access$800(Group.java:316) [marathon:0.13.0-RC6]
at com.twitter.common.zookeeper.Group$ActiveMembership$3.process(Group.java:433) [marathon:0.13.0-RC6]
at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:522) [marathon:0.13.0-RC6]
at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498) [marathon:0.13.0-RC6]
After reconnected to ZooKeeper, several Candidate Memberships are created and directly defeated (without beeing elected). :
INFO Set group member ID to member_0000000535 (com.twitter.common.zookeeper.Group:qtp983834017-928-EventThread)
INFO Candidate /marathon/leader/member_0000000535 waiting for the next leader election, current voting: [member_0000000529, member_0000000534, member_0000000535] (com.twitter.common.zookeeper.Can
INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(Maratho
INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-6)
INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-928-EventThread)
INFO Set group member ID to member_0000000536 (com.twitter.common.zookeeper.Group:qtp983834017-928-EventThread)
INFO Zookeeper session expired. Event: WatchedEvent state:Expired type:None path:null (com.twitter.common.zookeeper.ZooKeeperClient:qtp983834017-928-EventThread)
INFO Candidate /marathon/leader/member_0000000536 waiting for the next leader election, current voting: [member_0000000529, member_0000000534, member_0000000535, member_0000000536] (com.twitter.c
INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(Maratho
INFO Session: 0x151610f17890001 closed (org.apache.zookeeper.ZooKeeper:qtp983834017-928-EventThread)
INFO EventThread shut down (org.apache.zookeeper.ClientCnxn:qtp983834017-928-EventThread)
INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-8)
INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Initiating client connection, connectString=srv2.hw.ca1.mesosphere.com:2181,srv3.hw.ca1.mesosphere.com:2181,srv4.hw.ca1.mesosphere.com:2181,srv5.hw.ca1.mesosphere.com:2181,srv6.hw.ca1.mesosp
INFO Opening socket connection to server srv2.hw.ca1.mesosphere.com/172.16.0.12:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn:qtp983834017-338
INFO Socket connection established to srv2.hw.ca1.mesosphere.com/172.16.0.12:2181, initiating session (org.apache.zookeeper.ClientCnxn:qtp983834017-3384-SendThread(srv2.hw.ca1.mesosphere.com:2181
INFO Session establishment complete on server srv2.hw.ca1.mesosphere.com/172.16.0.12:2181, sessionid = 0x151610f17890003, negotiated timeout = 10000 (org.apache.zookeeper.ClientCnxn:qtp983834017-
INFO Set group member ID to member_0000000537 (com.twitter.common.zookeeper.Group:qtp983834017-3384-EventThread)
INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(Maratho
INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-6)
INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:ZookeeperClient-watcherProcessor)
INFO Set group member ID to member_0000000538 (com.twitter.common.zookeeper.Group:ZookeeperClient-watcherProcessor)
ERROR Current member ID member_0000000538 is not a candidate for leader, current voting: [member_0000000529, member_0000000534, member_0000000537] (com.twitter.common.zookeeper.CandidateImpl:qtp9
INFO Defeated (Leader Interface) (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Call onDefeated leadership callbacks on EntityStoreCache(MarathonStore(app:)), EntityStoreCache(MarathonStore(group:)), EntityStoreCache(MarathonStore(deployment:)), EntityStoreCache(Maratho
INFO Finished onDefeated leadership callbacks (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Defeat leadership (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Now standing by. Closing existing handles and rejecting new. (mesosphere.marathon.event.http.HttpEventStreamActor:marathon-akka.actor.default-dispatcher-6)
INFO Stopping driver (mesosphere.marathon.MarathonSchedulerService$$EnhancerByGuice$$1bda83eb:qtp983834017-3384-EventThread)
INFO Set group member ID to member_0000000539 (com.twitter.common.zookeeper.Group:qtp983834017-3384-EventThread)
INFO EventThread shut down (org.apache.zookeeper.ClientCnxn:qtp983834017-3384-EventThread)
The ephemeral nodes created here, are not deleted.
We are running into the very same problem in our Marathon cluster. It is occurring as often as 3 to 4 times per week and has become a major issue for us.
I notice that the suspected culprit #2509 has been fixed, but this ticket is still open and the 0.15.2 release notes do not mention anything in this regards. Is there still reason to believe the bug continues to persist, or is the verification part of the fix just outstanding?
For the record, we're running 0.14.1.
Thanks.
For the record: We upgraded to 0.15.2 but the problem persists.
Is there a chance to increase attention on the issue? Or provide some pointers (if available) where one should start digging in the code to figure out the root cause of the problem?
Thank you.
@alexanderweber @gkleiman any progress on this?
@aquamatthias sorry for the massive delay. Should I still look into Curator? Please let me know